mirror of
https://github.com/m-xlsea/ruoyi-plus-soybean.git
synced 2025-09-24 07:49:47 +08:00
feat: 整合 sse 推送
This commit is contained in:
@ -4,7 +4,7 @@ import { defineStore } from 'pinia';
|
||||
import { useLoading } from '@sa/hooks';
|
||||
import { SetupStoreId } from '@/enum';
|
||||
import { useRouterPush } from '@/hooks/common/router';
|
||||
import { fetchGetUserInfo, fetchLogin } from '@/service/api';
|
||||
import { fetchGetUserInfo, fetchLogin, fetchLogout } from '@/service/api';
|
||||
import { localStg } from '@/utils/storage';
|
||||
// import { $t } from '@/locales';
|
||||
import { useRouteStore } from '../route';
|
||||
@ -52,6 +52,11 @@ export const useAuthStore = defineStore(SetupStoreId.Auth, () => {
|
||||
routeStore.resetStore();
|
||||
}
|
||||
|
||||
async function logout() {
|
||||
await fetchLogout();
|
||||
resetStore();
|
||||
}
|
||||
|
||||
/**
|
||||
* Login
|
||||
*
|
||||
@ -147,6 +152,7 @@ export const useAuthStore = defineStore(SetupStoreId.Auth, () => {
|
||||
loginLoading,
|
||||
resetStore,
|
||||
login,
|
||||
logout,
|
||||
initUserInfo
|
||||
};
|
||||
});
|
||||
|
Reference in New Issue
Block a user