ZaiZai 1 jaar geleden
bovenliggende
commit
33e68a4048
3 gewijzigde bestanden met toevoegingen van 7 en 35 verwijderingen
  1. 1 1
      package.json
  2. 2 30
      src/App.vue
  3. 4 4
      yarn.lock

+ 1 - 1
package.json

@@ -21,7 +21,7 @@
         "dayjs": "^1.11.10",
         "echarts": "^5.4.3",
         "element-plus": "2.5.0",
-        "hc-vue3-ui": "^2.7.8",
+        "hc-vue3-ui": "^2.8.7",
         "js-base64": "^3.7.5",
         "js-fast-way": "^0.3.8",
         "js-md5": "^0.8.3",

+ 2 - 30
src/App.vue

@@ -7,10 +7,8 @@
 <script setup>
 import { nextTick, ref, watch } from 'vue'
 import { useAppStore } from '~src/store'
-import { useOsTheme } from 'hc-vue3-ui'
+import { getAppVersion, useOsTheme } from 'hc-vue3-ui'
 import { getObjValue, setElementMainColor } from 'js-fast-way'
-import { getStore, setStore } from 'hc-vue3-ui'
-import { getVersionJson } from '~api/other'
 import split from 'split.js'
 
 //初始变量
@@ -31,37 +29,11 @@ nextTick(() => {
     setUserTheme(appStore.getThemeVal, appStore.getColor)
     //生产环境下,检测更新
     if (import.meta.env.PROD) {
-        getVersionJsonApi()
-        //检测新版本
-        setInterval(() => {
-            getVersionJsonApi()
-        }, 1000 * 60)
+        getAppVersion()
     }
     window['$split'] = split
 })
 
-//获取版本更新信息
-const getVersionJsonApi = async () => {
-    const cache_version = getStore('version')
-    const { res } = await getVersionJson()
-    const version = getObjValue(res)?.value
-    setStore('version', version)
-    if (cache_version && cache_version !== version) {
-        window?.$messageBox?.alert('检测到有新版本更新,请点击更新,或手动刷新网页更新,如果不更新,将无法使用相关功能', '更新提醒', {
-            showCancelButton: true,
-            confirmButtonText: '立即更新',
-            cancelButtonText: '暂不更新',
-            type: 'warning',
-            callback: (action) => {
-                if (action === 'confirm') {
-                    //刷新页面
-                    window.location.reload()
-                }
-            },
-        })
-    }
-}
-
 //设置主题
 const setUserTheme = (theme, appColor) => {
     const colorVal = getObjValue(appColor)

+ 4 - 4
yarn.lock

@@ -1844,10 +1844,10 @@ has-flag@^4.0.0:
   resolved "http://39.108.216.210:9000/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b"
   integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==
 
-hc-vue3-ui@^2.7.8:
-  version "2.8.5"
-  resolved "http://39.108.216.210:9000/hc-vue3-ui/-/hc-vue3-ui-2.8.5.tgz#cf91f5d8c522ec3f57fcdc818fdddfb39e6b8a04"
-  integrity sha512-/mgo6VRBgyFPznlxq6VAY1fqDC8sosQG3a7N54gUpTahXUn1rl6gaU9AjnQXQQgF4d3tf+bbuL1XF+gJL8wSyw==
+hc-vue3-ui@^2.8.7:
+  version "2.8.7"
+  resolved "http://39.108.216.210:9000/hc-vue3-ui/-/hc-vue3-ui-2.8.7.tgz#6ddbe08f918ea702fd7339a4f85b29f4c212c709"
+  integrity sha512-+eaWJmb6RHiOsL/p1rJrJ4QK/IIkcxIHAbcagmNjte8BKAs3xvllLAVrIqNY+lKziwYhD9MtOhKRvTUyUA5Jpg==
 
 human-signals@^2.1.0:
   version "2.1.0"