Explorar el Código

回退 'Pull Request !195 : 修复登录后通过登录页面无法再次登录的问题'

芋道源码 hace 1 año
padre
commit
b68f8be751
Se han modificado 2 ficheros con 3 adiciones y 5 borrados
  1. 3 2
      src/config/axios/service.ts
  2. 0 3
      src/views/Login/components/LoginForm.vue

+ 3 - 2
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) {

+ 0 - 3
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: '正在加载系统中...',