From df43dbd4f80baedb88764ca9545e4b5ec7e1ac73 Mon Sep 17 00:00:00 2001
From: PC-20250623MANY\Administrator <344137771@qq.com>
Date: Sun, 27 Jul 2025 16:26:34 +0800
Subject: [PATCH] 1
---
src/main.js | 48 ++++++++++++++++++++----------------------------
1 files changed, 20 insertions(+), 28 deletions(-)
diff --git a/src/main.js b/src/main.js
index 47d37b8..21422b3 100644
--- a/src/main.js
+++ b/src/main.js
@@ -33,6 +33,8 @@
import "lib-flexible";
// import md5 from 'js-md5'
import * as filters from "@/utils/utils";
+import * as filter from "@/utils/filter";
+import * as allocation from "@/utils/allocation";
import animated from "animate.css"; // npm install animate.css --save安装,在引入
import "../static/css/public2.css";
@@ -69,6 +71,12 @@
Vue.config.productionTip = false;
Object.keys(filters).forEach(key => {
Vue.filter(key, filters[key]);
+});
+Object.keys(filter).forEach(key => {
+ Vue.filter(key, filter[key]);
+});
+Object.keys(allocation).forEach(key => {
+ Vue.prototype[key] = allocation[key];
});
Vue.prototype.$state = state;
Vue.prototype.$setgoindex = function() {
@@ -124,37 +132,21 @@
}
}
};
-// 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,
+ to.meta.requireAuth && !!!store.state.token
+ );
+ if (to.meta.requireAuth && !!!store.state.token) {
+ next("/login");
+ return;
+ //点击管理后台分享的二维码 进入注册页面 会识别未登录 导致进入登录页面
+ }
// if (!to.query.url && from.query.url) {
// to.query.url = from.query.url
// }
--
Gitblit v1.9.3