From 8e4ab7acddbdb84fd755acf7e75cf471f50cba60 Mon Sep 17 00:00:00 2001 From: houzhongjian <houzhongyi@126.com> Date: 星期四, 31 十月 2024 10:16:47 +0800 Subject: [PATCH] 优化部分页面及配置 --- src/utils/auth.ts | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/src/utils/auth.ts b/src/utils/auth.ts index d836500..0b20e53 100644 --- a/src/utils/auth.ts +++ b/src/utils/auth.ts @@ -1,11 +1,12 @@ import { useCache, CACHE_KEY } from '@/hooks/web/useCache' -import { TokenType } from '@/api/login/types' +import {TokenType} from '@/api/login/types' import { decrypt, encrypt } from '@/utils/jsencrypt' const { wsCache } = useCache() const AccessTokenKey = 'ACCESS_TOKEN' const RefreshTokenKey = 'REFRESH_TOKEN' +const TenantId = 'tenantId' // 获取token export const getAccessToken = () => { @@ -22,6 +23,7 @@ export const setToken = (token: TokenType) => { wsCache.set(RefreshTokenKey, token.refreshToken) wsCache.set(AccessTokenKey, token.accessToken) + wsCache.set(TenantId, import.meta.env.VITE_TENANT_ID) } // 删除token -- Gitblit v1.9.3