Commit cccf8d8197a675b10fab0442f56b9456eb9dd98c

Authored by xingyu
1 parent 5450534a

fix: loginOut api

yudao-ui-admin-vue3/src/api/login/index.ts
... ... @@ -33,7 +33,7 @@ export const getTenantIdByNameApi = (name: string) => {
33 33  
34 34 // 登出
35 35 export const loginOutApi = () => {
36   - return request.delete({ url: '/system/auth/logout' })
  36 + return request.post({ url: '/system/auth/logout' })
37 37 }
38 38  
39 39 // 获取用户权限信息
... ...
yudao-ui-admin-vue3/src/layout/components/UserInfo/src/UserInfo.vue
... ... @@ -35,7 +35,7 @@ const loginOut = () => {
35 35 type: 'warning'
36 36 })
37 37 .then(async () => {
38   - userStore.loginOut()
  38 + await userStore.loginOut()
39 39 tagsViewStore.delAllViews()
40 40 replace('/login?redirect=/index')
41 41 })
... ...
yudao-ui-admin-vue3/src/store/modules/user.ts
... ... @@ -2,7 +2,7 @@ import { store } from '../index'
2 2 import { defineStore } from 'pinia'
3 3 import { getAccessToken, removeToken } from '@/utils/auth'
4 4 import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
5   -import { getInfoApi } from '@/api/login'
  5 +import { getInfoApi, loginOutApi } from '@/api/login'
6 6  
7 7 const { wsCache } = useCache()
8 8  
... ... @@ -59,7 +59,8 @@ export const useUserStore = defineStore('admin-user', {
59 59 this.isSetUser = true
60 60 wsCache.set(CACHE_KEY.USER, userInfo)
61 61 },
62   - loginOut() {
  62 + async loginOut() {
  63 + await loginOutApi()
63 64 removeToken()
64 65 wsCache.clear()
65 66 this.resetState()
... ...