2022-05-20 16:40:09 +08:00
|
|
|
|
import Vue from "vue";
|
|
|
|
|
import App from "./App";
|
|
|
|
|
import router from "./router";
|
|
|
|
|
import ViewUI from "view-design";
|
|
|
|
|
import "./assets/styles/theme.less";
|
2021-09-06 17:01:38 +08:00
|
|
|
|
// import './assets/iconfont/iconfont.css';
|
2022-05-20 16:40:09 +08:00
|
|
|
|
import * as filters from "./plugins/filters";
|
|
|
|
|
import store from "@/vuex/store";
|
|
|
|
|
import storage from "@/plugins/storage";
|
2021-05-13 10:56:04 +08:00
|
|
|
|
// 全局引入封装组件
|
2022-05-20 16:40:09 +08:00
|
|
|
|
import { InstallAll } from "@/components/global.js";
|
2021-05-13 10:56:04 +08:00
|
|
|
|
|
2022-05-20 16:40:09 +08:00
|
|
|
|
const { aMapSecurityJsCode, title } = require("@/config");
|
2021-05-13 10:56:04 +08:00
|
|
|
|
Vue.use(ViewUI);
|
|
|
|
|
Vue.use(InstallAll);
|
|
|
|
|
Vue.config.productionTip = false;
|
|
|
|
|
|
2022-05-20 16:40:09 +08:00
|
|
|
|
Object.keys(filters).forEach((key) => {
|
2021-05-13 10:56:04 +08:00
|
|
|
|
Vue.filter(key, filters[key]);
|
|
|
|
|
});
|
|
|
|
|
|
2022-05-20 16:40:09 +08:00
|
|
|
|
// 高德安全密钥
|
|
|
|
|
if (aMapSecurityJsCode) {
|
|
|
|
|
window._AMapSecurityConfig = {
|
|
|
|
|
securityJsCode: aMapSecurityJsCode,
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
2021-05-13 10:56:04 +08:00
|
|
|
|
router.beforeEach((to, from, next) => {
|
|
|
|
|
ViewUI.LoadingBar.start();
|
2022-05-20 16:40:09 +08:00
|
|
|
|
window.document.title = to.meta.title === undefined ? title : to.meta.title;
|
2021-05-13 10:56:04 +08:00
|
|
|
|
next();
|
|
|
|
|
});
|
|
|
|
|
|
2022-05-20 16:40:09 +08:00
|
|
|
|
router.afterEach((route) => {
|
2021-05-13 10:56:04 +08:00
|
|
|
|
ViewUI.LoadingBar.finish();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Vue.prototype.linkTo = function (url) {
|
2022-05-20 16:40:09 +08:00
|
|
|
|
if (url.substr(0, 1) === "/") {
|
|
|
|
|
// 非外部链接,没有origin,只有路由地址
|
|
|
|
|
if (router.mode === "hash") {
|
|
|
|
|
window.open(location.origin + "/#" + url, "_blank");
|
2021-07-16 17:57:24 +08:00
|
|
|
|
} else {
|
2022-05-20 16:40:09 +08:00
|
|
|
|
window.open(location.origin + url, "_blank");
|
2021-07-16 17:57:24 +08:00
|
|
|
|
}
|
2022-05-20 16:40:09 +08:00
|
|
|
|
} else {
|
|
|
|
|
// 外部链接,完整的url地址
|
|
|
|
|
window.open(url, "_blank");
|
2021-05-13 10:56:04 +08:00
|
|
|
|
}
|
2022-05-20 16:40:09 +08:00
|
|
|
|
};
|
2021-05-31 18:03:48 +08:00
|
|
|
|
// 联系客服
|
2022-05-20 16:40:09 +08:00
|
|
|
|
Vue.prototype.connectCs = function (
|
|
|
|
|
sign = "37ef9b97807d03c6741298ed4eb5b536d2d238e08a3c00fb01fe48f03a569974c99ad767e72c04b3165ef29aca2c488b505fe4ca"
|
|
|
|
|
) {
|
|
|
|
|
const url = "https://yzf.qq.com/xv/web/static/chat/index.html?sign=" + sign;
|
|
|
|
|
window.open(url, "_blank");
|
|
|
|
|
};
|
|
|
|
|
Vue.prototype.Cookies = storage;
|
2021-05-13 10:56:04 +08:00
|
|
|
|
/* eslint-disable no-new */
|
|
|
|
|
new Vue({
|
|
|
|
|
router,
|
|
|
|
|
store,
|
2022-05-20 16:40:09 +08:00
|
|
|
|
render: (h) => h(App),
|
|
|
|
|
}).$mount("#app");
|