From 085fa2fb257e9f11f8f6d34bf12e2dc281c36b4d Mon Sep 17 00:00:00 2001
From: odc.xiaohui <xiaohui@Q1>
Date: 星期四, 09 二月 2023 11:28:21 +0800
Subject: [PATCH] 2023/2/9 肖辉 修改部门管理
---
src/main.js | 28 ++++++++++++++++++++++++----
1 files changed, 24 insertions(+), 4 deletions(-)
diff --git a/src/main.js b/src/main.js
index 8ea7900..ed23992 100644
--- a/src/main.js
+++ b/src/main.js
@@ -9,15 +9,35 @@
import ElementUI from 'element-ui';
import "element-ui/lib/theme-chalk/index.css";
// 寮曞叆icons
-import './assets/icons'
+import './assets/icons'
// 寮曞叆鍏ㄥ眬鏍峰紡
-import '@/styles/index.scss'
+import '@/styles/index.scss'
import api from "./utils/request"
-Vue.prototype.$axios=api
-console.log(process.env.VUE_APP_BASE_API);
+
+import 'leaflet.pm'
+import 'leaflet.pm/dist/leaflet.pm.css'
+
+import map from '@/utils/map'
+Vue.prototype.$map = map
+Vue.prototype.$axios = api
+router.beforeEach((to, from, next) => {
+ if (to.meta.needLogin) {
+ const token = sessionStorage.getItem('token');
+ const tokenHead = sessionStorage.getItem('tokenHead');
+ if (token && tokenHead) {
+ next();
+ } else {
+ router.push("/login");
+ next();
+ }
+ } else {
+ next();
+ }
+})
Vue.use(ElementUI);
new Vue({
router,
store,
render: h => h(App)
}).$mount('#app')
+// Vue.config.devtools=true
\ No newline at end of file
--
Gitblit v1.8.0