This commit is contained in:
dap
2024-08-20 08:44:26 +08:00
99 changed files with 1312 additions and 785 deletions

View File

@@ -72,7 +72,7 @@ export const useAuthStore = defineStore('auth', () => {
};
}
async function logout() {
async function logout(redirect: boolean = true) {
try {
await doLogout();
} catch (error) {
@@ -84,9 +84,11 @@ export const useAuthStore = defineStore('auth', () => {
// 回登陆页带上当前路由地址
await router.replace({
path: LOGIN_PATH,
query: {
redirect: encodeURIComponent(router.currentRoute.value.fullPath),
},
query: redirect
? {
redirect: encodeURIComponent(router.currentRoute.value.fullPath),
}
: {},
});
}
}