5 changed files with 28 additions and 17 deletions
@ -0,0 +1,14 @@ |
|||
import type { Router } from 'vue-router'; |
|||
import { appStore } from '/@/store/modules/app'; |
|||
import { PageEnum } from '/@/enums/pageEnum'; |
|||
import { removeTabChangeListener } from '/@/logics/mitt/tabChange'; |
|||
|
|||
export function createHttpGuard(router: Router) { |
|||
router.afterEach((to) => { |
|||
// Just enter the login page and clear the authentication information
|
|||
if (to.path === PageEnum.BASE_LOGIN) { |
|||
appStore.resumeAllState(); |
|||
removeTabChangeListener(); |
|||
} |
|||
}); |
|||
} |
|||
Loading…
Reference in new issue