From 9c3050a2b8e140f91c830cfafd1f5300f4b5dd72 Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Mon, 16 Dec 2024 19:40:06 +0800
Subject: [PATCH] 新干路由配置调整、作战图显示调整
---
src/permission.js | 17 +++++++++++------
1 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/src/permission.js b/src/permission.js
index 652bd76..aaf2d43 100644
--- a/src/permission.js
+++ b/src/permission.js
@@ -2,7 +2,7 @@
* @Author: shuishen 1109946754@qq.com
* @Date: 2024-10-30 17:03:57
* @LastEditors: shuishen 1109946754@qq.com
- * @LastEditTime: 2024-10-30 17:07:40
+ * @LastEditTime: 2024-12-16 19:35:12
* @FilePath: \bigScreen\src\permission.js
* @Description:
*
@@ -22,14 +22,19 @@
const meta = to.meta || {}
if (token) {
- if (to.path === '/login') {
- //如果登录成功访问登录页跳转到主页
+ if (!to.matched.length) {
+ // 如果路由不存在
next({ path: '/' })
} else {
- if (token.length === 0) {
- next({ path: '/login' })
+ if (to.path === '/login') {
+ //如果登录成功访问登录页跳转到主页
+ next({ path: '/' })
} else {
- next()
+ if (token.length === 0) {
+ next({ path: '/login' })
+ } else {
+ next()
+ }
}
}
} else {
--
Gitblit v1.9.3