mirror of
https://gh-proxy.org/https://github.com/tiajinsha/JKVideo
synced 2026-07-07 23:18:38 +08:00
优化
This commit is contained in:
@@ -38,10 +38,15 @@ export function LoginModal({ visible, onClose }: Props) {
|
||||
if (result.code === 86090) setStatus('scanned');
|
||||
if (result.code === 0 && result.cookie) {
|
||||
clearInterval(pollRef.current!);
|
||||
await login(result.cookie, '', '');
|
||||
setStatus('done');
|
||||
// 登录后异步拉取用户头像和昵称
|
||||
getUserInfo().then(info => setProfile(info.face, info.uname, String(info.mid))).catch(() => {});
|
||||
try {
|
||||
await login(result.cookie, '', '');
|
||||
setStatus('done');
|
||||
// 登录后异步拉取用户头像和昵称
|
||||
const info = await getUserInfo();
|
||||
setProfile(info.face, info.uname, String(info.mid));
|
||||
} catch {
|
||||
setStatus('error');
|
||||
}
|
||||
onClose();
|
||||
}
|
||||
}, 2000);
|
||||
|
||||
Reference in New Issue
Block a user