diff --git a/src/store/token.ts b/src/store/token.ts index 2ebf009..6b36bca 100644 --- a/src/store/token.ts +++ b/src/store/token.ts @@ -54,6 +54,10 @@ export const useTokenStore = defineStore( * 判断token是否过期 */ const isTokenExpired = computed(() => { + if (!tokenInfo.value) { + return true + } + const now = Date.now() const expireTime = uni.getStorageSync('accessTokenExpireTime')