城阳pc工作端前端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

86 lines
2.1 KiB

import Vue from "vue";
import Element from "element-ui";
import App from "@/App";
import i18n from "@/i18n";
import router from "@/router";
import "@/icons";
import "@/element-ui/theme/index.css";
import "@/assets/scss/aui.scss";
//按钮
import http from "@/utils/request";
import cloneDeep from "lodash/cloneDeep";
// axios封装
import ajax from "@/js/ajax";
// service
import service from "@/js/service";
// vuex处理多个组件共享状态
import store from "@/js/store";
//系统工具
import util from "@js/util";
// import Cookies from "js-cookie";
import getQueryPara from "dai-js/modules/getQueryPara";
// 兼容token传参登录
if (getQueryPara("token")) {
console.log("token", getQueryPara("token"));
localStorage.setItem("token", getQueryPara("token"));
console.log("token222222", localStorage.getItem("token"));
}
window.app = Object.assign(
{},
{
util,
ajax,
service,
}
);
Vue.config.productionTip = false;
Vue.use(Element, {
size: "default",
i18n: (key, value) => i18n.t(key, value),
});
// 弹窗底部滚动问题 弹窗需配合v-if使用
Vue.directive("fixed", {
inserted() {
let scrollTop =
document.body.scrollTop || document.documentElement.scrollTop;
document.body.style.cssText +=
"position:fixed;width:100%;top:-" + scrollTop + "px;";
},
unbind() {
let body = document.body;
body.style.position = "";
let top = body.style.top;
document.body.scrollTop = document.documentElement.scrollTop =
-parseInt(top);
body.style.top = "";
},
});
// 挂载全局
Vue.prototype.$http = http;
// el-uploader的header配置
Vue.prototype.$getElUploadHeaders = () => ({
Authorization: localStorage.getItem("token") || "",
});
// Vue.prototype.$getDictLabel = getDictLabel
// 保存整站vuex本地储存初始状态
window.SITE_CONFIG["storeState"] = cloneDeep(store.state);
Vue.prototype.tableHeaderStyle = { background: 'linear-gradient(0deg, #005EB3 0%, #0083F0 100%)', color: '#FFFFFF', padding: '6px 0px' };
new Vue({
i18n,
router,
store,
render: (h) => h(App),
}).$mount("#app");