Merge branch 'main' of https://github.com/vbenjs/vue-vben-admin
This commit is contained in:
@@ -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),
|
||||
}
|
||||
: {},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user