From 91f9b7a3b7dfc4fe6b9b5008cfec4e18dfb6dcd5 Mon Sep 17 00:00:00 2001
From: zzzz <690498789@qq.com>
Date: Thu, 28 Mar 2024 13:04:36 +0800
Subject: [PATCH] 注册页面的客服地址错误
---
src/main.js | 33 +++++----------------------------
1 files changed, 5 insertions(+), 28 deletions(-)
diff --git a/src/main.js b/src/main.js
index 47d37b8..191f9eb 100644
--- a/src/main.js
+++ b/src/main.js
@@ -124,37 +124,14 @@
}
}
};
-// router.beforeEach((to, from, next) => {
-// console.log(to.path)
-// store.state.select = to.path
-// document.title = to.meta.title || '亿点通'
-// // 判断是否登录
-// console.log(document.cookie)
-// // console.log(checkCookie(),'checkCookie()')
-// if(!to.meta.requireAuth){
-// next()
-// return
-// }
-// if (document.cookie && to.meta.requireAuth) {
-// if (to.path === '/login') {
-// next({ path: '/' })
-// } else {
-// if (!to.query.url && from.query.url) {
-// to.query.url = from.query.url
-// }
-// next()
-// }
-// }else{
-// if (to.path === '/login') {
-// next()
-// } else {
-// next({ path: '/login' })
-// }
-// }
-// })
+
router.beforeEach((to, from, next) => {
store.state.select = to.path;
document.title = to.meta.title;
+ console.log(store.state, "store.state", !!store.state.token);
+ if (to.meta.requireAuth && !!!store.state.token) {
+ next("/login");
+ }
// if (!to.query.url && from.query.url) {
// to.query.url = from.query.url
// }
--
Gitblit v1.9.3