| | |
| | | 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); |
| | | Vue.use(ElementUI) |
| | | |
| | | 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 |