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

This commit is contained in:
ssongliu 2024-03-15 16:00:08 +08:00 committed by GitHub
parent 825ebd19fb
commit a0907592b2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 11038 additions and 2669 deletions

13702
frontend/package-lock.json generated

File diff suppressed because it is too large Load diff

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 },