From b68f8be7519dcf447a74ab9fa7578cae8fbc55ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8A=8B=E9=81=93=E6=BA=90=E7=A0=81?= Date: Sat, 19 Aug 2023 08:01:09 +0000 Subject: [PATCH] =?UTF-8?q?=E5=9B=9E=E9=80=80=20'Pull=20Request=20!195=20:?= =?UTF-8?q?=20=E4=BF=AE=E5=A4=8D=E7=99=BB=E5=BD=95=E5=90=8E=E9=80=9A?= =?UTF-8?q?=E8=BF=87=E7=99=BB=E5=BD=95=E9=A1=B5=E9=9D=A2=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E5=86=8D=E6=AC=A1=E7=99=BB=E5=BD=95=E7=9A=84=E9=97=AE=E9=A2=98?= =?UTF-8?q?'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/config/axios/service.ts | 5 +++-- src/views/Login/components/LoginForm.vue | 3 --- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/config/axios/service.ts b/src/config/axios/service.ts index 3a4635f0..1a4741b6 100644 --- a/src/config/axios/service.ts +++ b/src/config/axios/service.ts @@ -31,7 +31,7 @@ let requestList: any[] = [] // 是否正在刷新中 let isRefreshToken = false // 请求白名单,无须token的接口 -const whiteList: string[] = ['/login', '/refresh-token', '/system/tenant/get-id-by-name'] +const whiteList: string[] = ['/login', '/refresh-token'] // 创建axios实例 const service: AxiosInstance = axios.create({ @@ -47,7 +47,8 @@ service.interceptors.request.use( let isToken = (config!.headers || {}).isToken === false whiteList.some((v) => { if (config.url) { - return (isToken = config.url.indexOf(v) > -1) + config.url.indexOf(v) > -1 + return (isToken = false) } }) if (getAccessToken() && !isToken) { diff --git a/src/views/Login/components/LoginForm.vue b/src/views/Login/components/LoginForm.vue index 190c5aa1..82dbe3fc 100644 --- a/src/views/Login/components/LoginForm.vue +++ b/src/views/Login/components/LoginForm.vue @@ -148,8 +148,6 @@ import { ElLoading } from 'element-plus' import LoginFormTitle from './LoginFormTitle.vue' import type { RouteLocationNormalizedLoaded } from 'vue-router' -import { CACHE_KEY, useCache } from '@/hooks/web/useCache' -const { wsCache } = useCache() import { useIcon } from '@/hooks/web/useIcon' import * as authUtil from '@/utils/auth' @@ -246,7 +244,6 @@ const handleLogin = async (params) => { if (!res) { return } - wsCache.delete(CACHE_KEY.USER) // 清除上次登录用户信息 ElLoading.service({ lock: true, text: '正在加载系统中...',