From d942877495ceea1575e64fb6d4e2972f6da10cac Mon Sep 17 00:00:00 2001 From: odc.xiaohui <xiaohui@Q1> Date: 星期三, 11 一月 2023 10:09:24 +0800 Subject: [PATCH] 2023/1/11 肖辉 修改UI样式 --- src/main.js | 23 ++++++++++++++++++++--- 1 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/main.js b/src/main.js index 79b408f..5c21072 100644 --- a/src/main.js +++ b/src/main.js @@ -9,12 +9,29 @@ import ElementUI from 'element-ui'; import "element-ui/lib/theme-chalk/index.css"; // 寮曞叆icons -import './assets/icons' +import './assets/icons' // 寮曞叆鍏ㄥ眬鏍峰紡 -import '@/styles/index.scss' -Vue.use(ElementUI) +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(); + } +}) +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