Skip to content

Commit 5715909

Browse files
fix: use antd message API directly in login callback
Co-authored-by: aider (deepseek/deepseek-chat) <aider@aider.chat>
1 parent b60de10 commit 5715909

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/pages/Login/Callback.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React, { useEffect } from 'react';
22
import { useLocation, useNavigate } from '@umijs/max';
33
import { Session } from '@/utils/storage';
44
import { TOKEN_KEY } from '@/enums/cacheEnum';
5-
import { App, Spin } from 'antd';
5+
import { message, Spin } from 'antd';
66
import { useIntl } from '@@/exports';
77

88
const INTL = {
@@ -17,14 +17,14 @@ const INTL = {
1717
const Callback: React.FC = () => {
1818
const location = useLocation();
1919
const navigate = useNavigate();
20-
const { message } = App.useApp();
2120
const intl = useIntl();
2221

2322
useEffect(() => {
24-
const handleCallback = () => {
23+
const handleCallback = () => {
2524
// Parse the query parameters from the URL
2625
const searchParams = new URLSearchParams(location.search);
2726
const accessToken = searchParams.get('access_token');
27+
2828
if (accessToken) {
2929
// Store the token
3030
Session.set(TOKEN_KEY, accessToken);
@@ -39,7 +39,7 @@ const Callback: React.FC = () => {
3939
};
4040

4141
handleCallback();
42-
}, [location, navigate, message, intl]);
42+
}, [location, navigate, intl]);
4343

4444
return (
4545
<div style={{

0 commit comments

Comments
 (0)