ow
This commit is contained in:
1 parent
32f237c4bf
commit
8a2adb0a92
18 files changed
+418
-53
No files matched your search
@@ -69,6 +69,15 @@ export function clearLoginState() {
|
||||
uni.removeStorageSync(JWT_STORAGE_KEY);
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否已有登录会话:只认请求层的 AccessToken(令牌唯一来源,与 nav-guard 口径一致)。
|
||||
* 不在此判过期——AccessToken 过期时请求层会拿 RefreshToken 自动续期,续期失败再 goLogin 退回登录页,
|
||||
* 所以"登录过"就足以决定冷启动是否直接进 dashboard。
|
||||
*/
|
||||
export function hasLoginSession(): boolean {
|
||||
return !!getJwtInfo()?.AccessToken;
|
||||
}
|
||||
|
||||
function getToken(): string {
|
||||
return getJwtInfo()?.AccessToken ?? "";
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user