控制台前端页面升级

This commit is contained in:
暮光:城中城
2020-12-20 21:59:09 +08:00
parent dfb1e62074
commit a5fcdea2fa
78 changed files with 7664 additions and 8025 deletions

View File

@@ -3,57 +3,41 @@ import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import App from './App.vue'
import global from './common/config/global'
import apimix from './common/config/apimix'
import common from './common/lib/common/common'
import toast from './common/lib/common/toast'
import VueRouter from 'vue-router'
import routes from './routes'
import store from './store/index'
import axios from 'axios'
import VueAxios from 'vue-axios'
import vueHljs from "vue-hljs";
import "vue-hljs/dist/vue-hljs.min.css";
Vue.use(ElementUI);
Vue.use(VueRouter);
Vue.use(VueAxios, axios);
Vue.use(vueHljs);
// 全局参数
Vue.prototype.global = global;
// 接口列表
Vue.prototype.apilist1 = apimix.apilist1;
Vue.prototype.apilist2 = apimix.apilist1;
// 公用方法
Vue.prototype.common = common;
Vue.prototype.toast = toast;
Vue.prototype.$store = store;
const router = new VueRouter({routes});
// 路由跳转时判断处理
router.beforeEach((to, from, next) => {
if (to.meta.title) {
document.title = to.meta.title
}
global.fullscreen = !!to.meta.fullscreen;
/* 判断该路由是否需要登录权限 */
if (to.matched.some(record => record.meta.requireAuth)) {
if (global.user.isLogin) {
next();
} else {
next({path: '/login'});
}
} else {
next();
}
if (to.meta.title) {
document.title = to.meta.title;
}
store.commit('global/setFullscreen', !!to.meta.fullscreen);
next();
});
new Vue({
let vue = new Vue({
el: '#app',
router,
render(h) {
var app = h(App);
global.vue = app.context;
return app;
return h(App);
}
});
export default vue;