Commit cccf8d8197a675b10fab0442f56b9456eb9dd98c
1 parent
5450534a
fix: loginOut api
Showing
3 changed files
with
5 additions
and
4 deletions
yudao-ui-admin-vue3/src/api/login/index.ts
yudao-ui-admin-vue3/src/layout/components/UserInfo/src/UserInfo.vue
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() | ... | ... |