mirror of
				https://gitee.com/hhyykk/ipms-sjy-ui.git
				synced 2025-10-31 02:08:45 +08:00 
			
		
		
		
	修复登录后通过登录页面无法再次登录的问题
This commit is contained in:
		| @@ -31,7 +31,7 @@ let requestList: any[] = [] | |||||||
| // 是否正在刷新中 | // 是否正在刷新中 | ||||||
| let isRefreshToken = false | let isRefreshToken = false | ||||||
| // 请求白名单,无须token的接口 | // 请求白名单,无须token的接口 | ||||||
| const whiteList: string[] = ['/login', '/refresh-token'] | const whiteList: string[] = ['/login', '/refresh-token', '/system/tenant/get-id-by-name'] | ||||||
|  |  | ||||||
| // 创建axios实例 | // 创建axios实例 | ||||||
| const service: AxiosInstance = axios.create({ | const service: AxiosInstance = axios.create({ | ||||||
| @@ -47,8 +47,7 @@ service.interceptors.request.use( | |||||||
|     let isToken = (config!.headers || {}).isToken === false |     let isToken = (config!.headers || {}).isToken === false | ||||||
|     whiteList.some((v) => { |     whiteList.some((v) => { | ||||||
|       if (config.url) { |       if (config.url) { | ||||||
|         config.url.indexOf(v) > -1 |         return (isToken = config.url.indexOf(v) > -1) | ||||||
|         return (isToken = false) |  | ||||||
|       } |       } | ||||||
|     }) |     }) | ||||||
|     if (getAccessToken() && !isToken) { |     if (getAccessToken() && !isToken) { | ||||||
|   | |||||||
| @@ -148,6 +148,8 @@ import { ElLoading } from 'element-plus' | |||||||
| import LoginFormTitle from './LoginFormTitle.vue' | import LoginFormTitle from './LoginFormTitle.vue' | ||||||
| import type { RouteLocationNormalizedLoaded } from 'vue-router' | import type { RouteLocationNormalizedLoaded } from 'vue-router' | ||||||
|  |  | ||||||
|  | import { CACHE_KEY, useCache } from '@/hooks/web/useCache' | ||||||
|  | const { wsCache } = useCache() | ||||||
| import { useIcon } from '@/hooks/web/useIcon' | import { useIcon } from '@/hooks/web/useIcon' | ||||||
|  |  | ||||||
| import * as authUtil from '@/utils/auth' | import * as authUtil from '@/utils/auth' | ||||||
| @@ -244,6 +246,7 @@ const handleLogin = async (params) => { | |||||||
|     if (!res) { |     if (!res) { | ||||||
|       return |       return | ||||||
|     } |     } | ||||||
|  |     wsCache.delete(CACHE_KEY.USER) // 清除上次登录用户信息 | ||||||
|     ElLoading.service({ |     ElLoading.service({ | ||||||
|       lock: true, |       lock: true, | ||||||
|       text: '正在加载系统中...', |       text: '正在加载系统中...', | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 lehug
					lehug