Ver Fonte

发布测试环境

lifanagju_citu há 6 meses atrás
pai
commit
1ab9ad5d8d
1 ficheiros alterados com 4 adições e 5 exclusões
  1. 4 5
      src/App.vue

+ 4 - 5
src/App.vue

@@ -6,7 +6,7 @@ import axios from 'axios'
 
 const openCheckVersion = true // 开启检测版本
 const timer = ref(null)
-const setIntervalTime = 300000 // 300000 五分钟
+const setIntervalTime = 3000 // 300000 五分钟
 function open () {
   if (timer.value) clearInterval(timer.value)
   timer.value = setInterval(() => { checkVersion() }, setIntervalTime)
@@ -33,7 +33,8 @@ const checkVersion = () => {
   // 
   if (!baseUrl || !version || !tenantId) return
   axios.get(`${baseUrl}/app-api/menduner/system/get/version`, {
-    headers: { ['tenant-id']: tenantId }
+    headers: { ['tenant-id']: tenantId },
+    cache: 'no-store' // 禁用缓存
   }).then((res) => {
     if (res?.data?.data !== version) {
       // const option = {
@@ -41,10 +42,8 @@ const checkVersion = () => {
       // }
       clearInterval(timer.value)
       timer.value = null
-      Confirm('系统提示', '发现新版本,是否立即刷新页面').then(() => {
+      Confirm('系统提示', '发现新版本,将立即刷新页面', { hideCancelBtn: true }).then(() => {
         window.location.reload()
-      }).catch(() => {
-        open()
       })
     }
   }).catch(err => {