fix: 解决未登录情况下的页面跳转问题 (#4195)

This commit is contained in:
ssongliu
2024-03-15 08:00:08 +00:00
committed by GitHub
parent 825ebd19fb
commit a0907592b2
2 changed files with 11038 additions and 2669 deletions
+11037 -2665
View File
File diff suppressed because it is too large Load Diff
+1 -4
View File
@@ -5,15 +5,12 @@ import { AxiosCanceler } from '@/api/helper/axios-cancel';
const axiosCanceler = new AxiosCanceler();
/**
* @description 路由拦截 beforeEach(路由配置无数种方法,个人觉得最简便)
* */
router.beforeEach((to, from, next) => {
NProgress.start();
axiosCanceler.removeAllPending();
const globalStore = GlobalStore();
if (to.name === 'home' && !globalStore.isLogin) {
if (to.name !== 'entrance' && !globalStore.isLogin) {
next({
name: 'entrance',
params: { code: globalStore.entrance },