更新juliang_callback接口

This commit is contained in:
Lrd
2026-06-25 18:02:34 +08:00
parent 772aa21fae
commit a8494c08a5
3 changed files with 41 additions and 16 deletions
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -28,7 +28,7 @@
}
})();
</script>
<script type="module" crossorigin src="/assets/index-CeDXrP7R.js"></script>
<script type="module" crossorigin src="/assets/index-Du_aYgTx.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-eLRg4pQk.css">
</head>
<body>
@@ -11,6 +11,7 @@ const AuthorizationWaitingPage: React.FC = () => {
const [countdown, setCountdown] = useState(0);
const [isChecking, setIsChecking] = useState(true);
const [authSuccess, setAuthSuccess] = useState(false);
const [authError, setAuthError] = useState('');
useEffect(() => {
const authCode = searchParams.get('auth_code');
@@ -40,8 +41,11 @@ const AuthorizationWaitingPage: React.FC = () => {
setTimeout(() => {
navigate('/authorization');
}, 1500);
} catch (error) {
console.log('授权回调失败,开始轮询检查...');
} catch (error: any) {
const errorMsg = error?.message || '授权失败';
setAuthError(errorMsg);
setIsChecking(false);
message.error(errorMsg);
}
};
@@ -83,6 +87,7 @@ const AuthorizationWaitingPage: React.FC = () => {
setCountdown(0);
setIsChecking(true);
setAuthSuccess(false);
setAuthError('');
window.location.href = '/authorization';
};
@@ -111,7 +116,27 @@ const AuthorizationWaitingPage: React.FC = () => {
)}
</div>
{countdown >= 10 ? (
{authError ? (
<>
<Typography.Title level={3} style={{ marginBottom: 16, color: '#ef4444' }}></Typography.Title>
<Typography.Text style={{ color: '#64748b', marginBottom: 24, display: 'block' }}>{authError}</Typography.Text>
<Button
type="primary"
size="large"
icon={<ReloadOutlined />}
onClick={handleRetry}
style={{
borderRadius: 8,
background: 'linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)',
border: 'none',
fontWeight: 600,
padding: '12px 32px',
}}
>
</Button>
</>
) : countdown >= 10 ? (
<>
<Typography.Title level={3} style={{ marginBottom: 16, color: '#ef4444' }}></Typography.Title>
<Typography.Text style={{ color: '#64748b', marginBottom: 24, display: 'block' }}></Typography.Text>