mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-10-11 16:06:02 +08:00
fix: 解决未登录情况下的页面跳转问题 (#4195)
This commit is contained in:
parent
825ebd19fb
commit
a0907592b2
2 changed files with 11038 additions and 2669 deletions
13702
frontend/package-lock.json
generated
13702
frontend/package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -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 },
|
||||
|
|
Loading…
Add table
Reference in a new issue