fix: 修复登出按钮无效 — 同时清除磁盘 cookie 和浏览器内存 context
- BrowserManager 新增 clearContext() 方法,关闭并丢弃平台 context - deleteCookies 同时调用 cookieStore.delete + browser.clearContext - 前端登出后直接 resetStatus,不再触发浏览器请求检查状态
This commit is contained in:
@@ -10,7 +10,7 @@ import { useToast } from '@/context/ToastContext';
|
||||
import { getLoginQRCode, deleteCookies, checkLoginCookie } from '@/api/endpoints';
|
||||
|
||||
export function LoginPage() {
|
||||
const { status, loading: statusLoading, refresh: refreshStatus } = useLoginStatus();
|
||||
const { status, loading: statusLoading, refresh: refreshStatus, reset: resetStatus } = useLoginStatus();
|
||||
const { token } = useAuth();
|
||||
const { toast } = useToast();
|
||||
|
||||
@@ -96,7 +96,7 @@ export function LoginPage() {
|
||||
const res = await deleteCookies();
|
||||
if (res.success) {
|
||||
toast('success', '已成功登出');
|
||||
void refreshStatus();
|
||||
resetStatus();
|
||||
} else {
|
||||
toast('error', res.error?.message || '登出失败');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user