Merge branch 'lichang' into lite

This commit is contained in:
TsMask
2025-04-29 18:19:20 +08:00
6 changed files with 30 additions and 251 deletions

View File

@@ -3,7 +3,8 @@ import {
CACHE_LOCAL_I18N,
CACHE_SESSION_CRYPTO_API,
} from '@/constants/cache-keys-constants';
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import { RESULT_CODE_EXCEPTION, RESULT_CODE_SUCCESS } from '@/constants/result-constants';
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';
@@ -131,6 +132,12 @@ const useAppStore = defineStore('app', {
localSet(CACHE_LOCAL_I18N, this.i18nDefault);
}
}
// 网络错误时退出登录状态
if (res.code === RESULT_CODE_EXCEPTION) {
delAccessToken();
delRefreshToken();
window.location.reload();
}
return res;
},
},