fix: 修复退出登录问题
This commit is contained in:
@@ -22,7 +22,7 @@ function logout() {
|
|||||||
okText: $t('common.confirm'),
|
okText: $t('common.confirm'),
|
||||||
cancelText: $t('common.cancel'),
|
cancelText: $t('common.cancel'),
|
||||||
onOk: () => {
|
onOk: () => {
|
||||||
authStore.resetStore();
|
authStore.resetStore(true);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ export const useAuthStore = defineStore(SetupStoreId.Auth, () => {
|
|||||||
*/
|
*/
|
||||||
async function resetStore(isMe = false) {
|
async function resetStore(isMe = false) {
|
||||||
if (isMe) {
|
if (isMe) {
|
||||||
doDeleteLogout();
|
await doDeleteLogout();
|
||||||
}
|
}
|
||||||
|
|
||||||
const authStore = useAuthStore();
|
const authStore = useAuthStore();
|
||||||
@@ -70,10 +70,10 @@ export const useAuthStore = defineStore(SetupStoreId.Auth, () => {
|
|||||||
startLoading();
|
startLoading();
|
||||||
|
|
||||||
const { data: loginToken, error } = await fetchLogin(loginForm);
|
const { data: loginToken, error } = await fetchLogin(loginForm);
|
||||||
|
|
||||||
if (!error) {
|
if (!error) {
|
||||||
const pass = await loginByToken(loginToken);
|
const pass = await loginByToken(loginToken);
|
||||||
onSuccess && onSuccess();
|
onSuccess && onSuccess();
|
||||||
|
|
||||||
if (pass) {
|
if (pass) {
|
||||||
await routeStore.initAuthRoute();
|
await routeStore.initAuthRoute();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user