From a654c8fd0b7ff9920eada1edf80438338ca3f5fa Mon Sep 17 00:00:00 2001
From: wl <173@qq.com>
Date: 星期五, 28 十月 2022 18:21:12 +0800
Subject: [PATCH] Merge branch 'master' of http://42.193.1.25:9521/r/sccg_ui into master
---
src/main.js | 29 +++++++++++++++++++++++++++--
1 files changed, 27 insertions(+), 2 deletions(-)
diff --git a/src/main.js b/src/main.js
index f253456..cd55ca2 100644
--- a/src/main.js
+++ b/src/main.js
@@ -2,9 +2,34 @@
import App from './App.vue'
import router from './router'
import store from './store'
-
Vue.config.productionTip = false
-
+// 寮曞叆鏍峰紡娓呴櫎
+import 'normalize.css/normalize.css'
+// 寮曞叆elementUI
+import ElementUI from 'element-ui';
+import "element-ui/lib/theme-chalk/index.css";
+// 寮曞叆icons
+import './assets/icons'
+// 寮曞叆鍏ㄥ眬鏍峰紡
+import '@/styles/index.scss'
+import api from "./utils/request"
+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();
+ }
+})
+// console.log(process.env.VUE_APP_BASE_API);
+Vue.use(ElementUI);
new Vue({
router,
store,
--
Gitblit v1.8.0