🐛 保留已验证的后台会话

This commit is contained in:
orion committed 2026-08-07 11:39:55 +08:00
1 parent 2bf610ac22
commit bb8b1449e1
1 file changed
+7 -2
+7 -2
View File
@@ -9,8 +9,13 @@ export function useAdminSession() {
try { try {
const response = await AuthService.verifyToken() const response = await AuthService.verifyToken()
if (response.code === 200 && response.detail?.token) { // The current stored bearer token is what was just verified by the server.
adminStore.login(response.detail) // Do not redirect a valid session merely because an adapter omits a token
// field in the verification payload; only replace it when one is supplied.
if (response.code === 200) {
if (response.detail?.token) {
adminStore.login(response.detail)
}
return true return true
} }
} catch { } catch {