mirror of
				https://gitee.com/hhyykk/ipms-sjy.git
				synced 2025-10-31 02:08:43 +08:00 
			
		
		
		
	fix: loginOut api
This commit is contained in:
		| @@ -33,7 +33,7 @@ export const getTenantIdByNameApi = (name: string) => { | |||||||
|  |  | ||||||
| // 登出 | // 登出 | ||||||
| export const loginOutApi = () => { | export const loginOutApi = () => { | ||||||
|   return request.delete({ url: '/system/auth/logout' }) |   return request.post({ url: '/system/auth/logout' }) | ||||||
| } | } | ||||||
|  |  | ||||||
| // 获取用户权限信息 | // 获取用户权限信息 | ||||||
|   | |||||||
| @@ -35,7 +35,7 @@ const loginOut = () => { | |||||||
|     type: 'warning' |     type: 'warning' | ||||||
|   }) |   }) | ||||||
|     .then(async () => { |     .then(async () => { | ||||||
|       userStore.loginOut() |       await userStore.loginOut() | ||||||
|       tagsViewStore.delAllViews() |       tagsViewStore.delAllViews() | ||||||
|       replace('/login?redirect=/index') |       replace('/login?redirect=/index') | ||||||
|     }) |     }) | ||||||
|   | |||||||
| @@ -2,7 +2,7 @@ import { store } from '../index' | |||||||
| import { defineStore } from 'pinia' | import { defineStore } from 'pinia' | ||||||
| import { getAccessToken, removeToken } from '@/utils/auth' | import { getAccessToken, removeToken } from '@/utils/auth' | ||||||
| import { CACHE_KEY, useCache } from '@/hooks/web/useCache' | import { CACHE_KEY, useCache } from '@/hooks/web/useCache' | ||||||
| import { getInfoApi } from '@/api/login' | import { getInfoApi, loginOutApi } from '@/api/login' | ||||||
|  |  | ||||||
| const { wsCache } = useCache() | const { wsCache } = useCache() | ||||||
|  |  | ||||||
| @@ -59,7 +59,8 @@ export const useUserStore = defineStore('admin-user', { | |||||||
|       this.isSetUser = true |       this.isSetUser = true | ||||||
|       wsCache.set(CACHE_KEY.USER, userInfo) |       wsCache.set(CACHE_KEY.USER, userInfo) | ||||||
|     }, |     }, | ||||||
|     loginOut() { |     async loginOut() { | ||||||
|  |       await loginOutApi() | ||||||
|       removeToken() |       removeToken() | ||||||
|       wsCache.clear() |       wsCache.clear() | ||||||
|       this.resetState() |       this.resetState() | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 xingyu
					xingyu