ref : 重构令牌管理逻辑,,统一状态码识别

This commit is contained in:
TsMask
2025-04-27 17:23:33 +08:00
parent f76311cf1b
commit 2de9788373
23 changed files with 229 additions and 253 deletions

View File

@@ -4,7 +4,7 @@ import {
CACHE_SESSION_CRYPTO_API,
} from '@/constants/cache-keys-constants';
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import { removeToken } from '@/plugins/auth-token';
import { delAccessToken, delRefreshToken } from '@/plugins/auth-token';
import { parseUrlPath } from '@/plugins/file-static-url';
import { localGet, localSet } from '@/utils/cache-local-utils';
import { sessionSet } from '@/utils/cache-session-utils';
@@ -94,7 +94,8 @@ const useAppStore = defineStore('app', {
this.bootloader = res.data.bootloader === 'true';
// 引导时
if (this.bootloader) {
removeToken();
delAccessToken();
delRefreshToken();
}
this.loginAuth = res.data.loginAuth !== 'false';
this.cryptoApi = res.data.cryptoApi !== 'false';