|
|
|
|
@ -11,7 +11,29 @@ import "./svg";
|
|
|
|
|
import moment from "moment";
|
|
|
|
|
import "moment/locale/zh-cn";
|
|
|
|
|
import AMap from "vue-amap";
|
|
|
|
|
import { message } from 'ant-design-vue'
|
|
|
|
|
Vue.prototype.$message = message;
|
|
|
|
|
message.config({
|
|
|
|
|
duration: 2,
|
|
|
|
|
maxCount: 1,
|
|
|
|
|
});
|
|
|
|
|
Vue.use(AMap);
|
|
|
|
|
|
|
|
|
|
router.onError((error) => {
|
|
|
|
|
console.log("路由报错")
|
|
|
|
|
const pattern = /net::ERR_ABORTED 404 (Not Found)/g;
|
|
|
|
|
const err = /Failed to fetch dynamically/g;
|
|
|
|
|
const isChunkLoadFailed = error.message.match(pattern);
|
|
|
|
|
const isChunkLoadFailedErr = error.message.match(err);
|
|
|
|
|
if (isChunkLoadFailed || isChunkLoadFailedErr) {
|
|
|
|
|
message.error('系统已升级,正在刷新本地存储,请稍候...');
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
location.reload();
|
|
|
|
|
}, 2000)
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
console.log("development");
|
|
|
|
|
Array.prototype.logResultStr = 'logResultStr'
|
|
|
|
|
Array.prototype.logResult = function(){
|
|
|
|
|
|