lilei 3 éve
szülő
commit
0b55add88b
2 módosított fájl, 9 hozzáadás és 3 törlés
  1. 1 1
      public/version.json
  2. 8 2
      src/libs/versionUpdate.js

+ 1 - 1
public/version.json

@@ -1,3 +1,3 @@
 {
-    "version": "1.0.2"
+    "version": "1.0.3"
 }

+ 8 - 2
src/libs/versionUpdate.js

@@ -1,5 +1,5 @@
 import axios from 'axios'
- 
+import modal from 'ant-design-vue/es/modal'
 const isNewVersion = () => {
   let url = `//${window.location.host}/version.json?t=${new Date().getTime()}`;
   axios.get(url).then(res => {
@@ -8,7 +8,13 @@ const isNewVersion = () => {
       let localVueVersion = localStorage.getItem('vueVersion');
       if (localVueVersion && localVueVersion != vueVersion) {
         localStorage.setItem('vueVersion', vueVersion);
-        window.location.reload();
+        modal.info({
+          title: '提示',
+          content: '发现有新版本发布,请确定刷新页面!',
+          onOk () {
+            window.location.reload()
+          }
+        })
         return;
       } else {
         localStorage.setItem('vueVersion', vueVersion);