mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2026-09-22 16:00:51 +00:00
fix: 解决未登录情况下的页面跳转问题 (#4195)
This commit is contained in:
Generated
+11037
-2665
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 },
|
||||
|
||||
Reference in New Issue
Block a user