From e6049c66fb92e64dc39ce291803c842533fd3729 Mon Sep 17 00:00:00 2001 From: zuohuaijun Date: Sun, 14 Sep 2025 15:17:16 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=98=8E=E5=89=8D=E7=AB=AF=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E6=A0=BC=E5=BC=8F=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Web/src/types/pinia.d.ts | 1 - Web/src/utils/axios-utils.ts | 10 +--------- Web/src/utils/sysInfo.ts | 2 -- 3 files changed, 1 insertion(+), 12 deletions(-) diff --git a/Web/src/types/pinia.d.ts b/Web/src/types/pinia.d.ts index 1a372c0f..ad101822 100644 --- a/Web/src/types/pinia.d.ts +++ b/Web/src/types/pinia.d.ts @@ -46,7 +46,6 @@ declare interface RoutesListState { // 布局配置 declare interface ThemeConfigState { themeConfig: { - serverTime?: Date; // 服务器时间 isDrawer: boolean; // 是否开启抽屉配置 primary: string; // 主题颜色 topBar: string; // 顶部栏背景 diff --git a/Web/src/utils/axios-utils.ts b/Web/src/utils/axios-utils.ts index 17263072..2331a9c1 100644 --- a/Web/src/utils/axios-utils.ts +++ b/Web/src/utils/axios-utils.ts @@ -11,11 +11,6 @@ import { BaseAPI, BASE_PATH } from '../api-services/system/base'; import { ElMessage } from 'element-plus'; import { Local, Session } from '../utils/storage'; -import { useThemeConfig } from '/@/stores/themeConfig'; -import { storeToRefs } from 'pinia'; - -const storesThemeConfig = useThemeConfig(); -const { themeConfig } = storeToRefs(storesThemeConfig); // 接口服务器配置 export const serveConfig = new Configuration({ @@ -71,7 +66,7 @@ axiosInstance.interceptors.request.use( const exp = getJWTDate(jwt.exp as number); // token 已经过期 - if (themeConfig.value.serverTime && themeConfig.value.serverTime >= exp) { + if (new Date() >= exp) { // 获取刷新 token const refreshAccessToken = Local.get(refreshAccessTokenKey); @@ -108,9 +103,6 @@ axiosInstance.interceptors.request.use( // axios 响应拦截 axiosInstance.interceptors.response.use( (res) => { - // 记录服务器时间 - themeConfig.value.serverTime = res.data.time ? new Date(res.data.time) : undefined; - // 获取状态码和返回数据 var status = res.status; var serve = res.data; diff --git a/Web/src/utils/sysInfo.ts b/Web/src/utils/sysInfo.ts index ecff715a..07919dee 100644 --- a/Web/src/utils/sysInfo.ts +++ b/Web/src/utils/sysInfo.ts @@ -65,8 +65,6 @@ export async function loadSysInfo(tenantid: number) { themeConfig.value.onlineNotice = data.onlineNotice; // 密码加解密公匙 window.__env__.VITE_SM_PUBLIC_KEY = data.publicKey; - // 服务器时间 - themeConfig.value.serverTime = res.data.time ? new Date(Date.parse(res.data.time as any)) : undefined; // 更新 favicon updateFavicon(data.logo);