mo 4 gadi atpakaļ
vecāks
revīzija
96c10bc5f4

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
dist/index.html


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
dist/static/css/chunk-4e7f9d56.b93a8602.css


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
dist/static/js/app.0c87d50b.js


+ 1 - 0
dist/static/js/chunk-2d0a32ea.166f0d63.js

@@ -0,0 +1 @@
+(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0a32ea"],{"00a5":function(t,n,e){"use strict";e.r(n);var c=function(){var t=this,n=t.$createElement,e=t._self._c||n;return e("div")},a=[],o=(e("a481"),{data:function(){return{}},created:function(){var t=this.$route.query;console.log(t.path),this.$confirm("页面更新请刷新页面","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){router.replace(t.path)}).catch(function(){})}}),r=o,u=e("2877"),i=Object(u["a"])(r,c,a,!1,null,null,null);n["default"]=i.exports}}]);

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
dist/static/js/chunk-elementUI.43eaef56.js


+ 5 - 0
package.json

@@ -20,7 +20,12 @@
     "clean-deep": "^3.3.0",
     "dayjs": "^1.8.35",
     "default-passive-events": "^1.0.10",
+<<<<<<< Updated upstream
     "element-ui": "^2.12.0",
+=======
+    "element-ui": "^2.13.2",
+    "http-server": "^0.12.3",
+>>>>>>> Stashed changes
     "i": "^0.3.6",
     "js-cookie": "2.2.0",
     "linq": "^3.2.2",

+ 32 - 0
src/main.js

@@ -74,6 +74,38 @@ Vue.use(VueAMap)
 Vue.use(ElementUI, { locale })
 
 Vue.config.productionTip = false
+<<<<<<< Updated upstream
+=======
+
+
+
+
+// const errorHandler = (error, vm) => {
+//   console.error('抛出全局异常');
+//   console.error(vm);
+//   console.error(error);
+//   if (error instanceof Error) {
+//     console.log(error.name)
+//     if (error.name.indexof('chunk')) {
+//       this.$confirm("页面更新请刷新页面", "提示", {
+//         confirmButtonText: "确定",
+//         cancelButtonText: "取消",
+//         type: "warning"
+//       })
+//         .then(() => {
+//           window.reload()
+//         })
+//         .catch(() => { });
+//     }
+//   }
+
+// }
+
+// Vue.config.errorHandler = errorHandler;
+// Vue.prototype.$throw = (error) => errorHandler(error, this);
+
+
+>>>>>>> Stashed changes
 
 new Vue({
   el: '#app',

+ 23 - 0
src/permission.js

@@ -1,3 +1,4 @@
+import Vue from 'vue'
 import router from './router'
 import store from './store'
 import { Message } from 'element-ui'
@@ -9,6 +10,26 @@ import getPageTitle from '@/utils/get-page-title'
 NProgress.configure({ showSpinner: false }) // NProgress Configuration
 
 const whiteList = ['/login'] // no redirect whitelist
+router.onError((error) => {
+  const isChunkLoadFailed = error.message.indexOf('chunk')
+  const targetPath = router.history.pending.fullPath;
+  if (isChunkLoadFailed) {
+    console.log(router.app.$confirm)
+    // router.push({ path: "/403", query: { path: targetPath } })
+    router.app.$confirm("网站有更新请点击确定刷新页面?", "更新提示", {
+      confirmButtonText: "确定",
+      cancelButtonText: "取消",
+      type: "warning"
+    })
+      .then(() => {
+        router.replace(targetPath);
+      })
+      .catch(() => {
+        return
+      });
+
+  }
+});
 
 router.beforeEach(async (to, from, next) => {
   // from.query = to.query
@@ -73,3 +94,5 @@ router.afterEach(() => {
   // finish progress bar
   NProgress.done()
 })
+
+

+ 5 - 0
src/router/index.js

@@ -92,6 +92,11 @@ export const constantRoutes = [
     component: () => import('@/views/404'),
     hidden: true
   },
+  {
+    path: '/403',
+    component: () => import('@/views/403'),
+    hidden: true
+  },
   // {
   //   path: '/sporadicManager',
   //   component: Layout,

+ 28 - 0
src/views/403.vue

@@ -0,0 +1,28 @@
+<template>
+  <div>
+
+  </div>
+</template>
+<script>
+export default {
+  data () {
+    return {
+
+    }
+  },
+  created () {
+    let query = this.$route.query
+    console.log(query.path)
+    this.$confirm("页面更新请刷新页面", "提示", {
+      confirmButtonText: "确定",
+      cancelButtonText: "取消",
+      type: "warning"
+    })
+      .then(() => {
+        router.replace(query.path);
+      })
+      .catch(() => { });
+
+  }
+}
+</script>

Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels