初始化代码

This commit is contained in:
2025-12-22 14:34:25 +08:00
parent c2c5ae2fdd
commit a77dbc743f
1510 changed files with 213008 additions and 0 deletions

35
web/src/main.js Normal file
View File

@@ -0,0 +1,35 @@
// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import ElementUI from 'element-ui'
import router from './router'
import 'element-ui/lib/theme-chalk/index.css'
import store from './store'
import {api} from './api' // 接口
import i18n from './i18n' // 语言包
import routes from './permission'
import './components/basics'
import reg from './utils/reg'
Vue.config.productionTip = false
Vue.use(ElementUI, { size: 'small', zIndex: 3000 })
Vue.prototype.$api = api
Vue.prototype.$reg = reg
router.beforeEach((to, from, next) => {
if (!store.getters.isAuth) {
store.dispatch('getUserPromission', {to, next, routes})
} else {
next()
}
})
/* eslint-disable no-new */
new Vue({
el: '#app',
router,
i18n,
store,
components: { App },
template: '<App/>'
})