退出登录清空数据修改
This commit is contained in:
@@ -59,7 +59,7 @@ function logout() {
|
||||
positiveText: '确定',
|
||||
negativeText: '取消',
|
||||
onPositiveClick: () => {
|
||||
authStore.resetStore();
|
||||
authStore.logout();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -38,6 +38,12 @@ export const useAuthStore = defineStore(SetupStoreId.Auth, () => {
|
||||
/** Is login */
|
||||
const isLogin = computed(() => Boolean(token.value));
|
||||
|
||||
function logout() {
|
||||
clearAuthStorage();
|
||||
localStg.clear();
|
||||
toLogin();
|
||||
}
|
||||
|
||||
/** Reset auth store */
|
||||
async function resetStore() {
|
||||
recordUserId();
|
||||
@@ -187,6 +193,7 @@ export const useAuthStore = defineStore(SetupStoreId.Auth, () => {
|
||||
loginLoading,
|
||||
resetStore,
|
||||
login,
|
||||
initUserInfo
|
||||
initUserInfo,
|
||||
logout
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user