chore: sse close before logout

This commit is contained in:
dap
2024-09-12 16:45:12 +08:00
parent 6b9c048d13
commit cd526828b3
3 changed files with 12 additions and 4 deletions

View File

@@ -10,7 +10,7 @@ import { resetAllStores, useAccessStore, useUserStore } from '@vben/stores';
import { notification } from 'ant-design-vue';
import { defineStore } from 'pinia';
import { doLogout, getUserInfoApi, loginApi } from '#/api';
import { doLogout, getUserInfoApi, loginApi, seeConnectionClose } from '#/api';
import { $t } from '#/locales';
export const useAuthStore = defineStore('auth', () => {
@@ -73,7 +73,9 @@ export const useAuthStore = defineStore('auth', () => {
}
async function logout(redirect: boolean = true) {
console.log(accessStore.accessToken);
try {
await seeConnectionClose();
await doLogout();
} catch (error) {
console.error(error);