소스 검색

去除系统更新提醒

zhuliu 2 주 전
부모
커밋
3645cadcb2
1개의 변경된 파일0개의 추가작업 그리고 39개의 파일을 삭제
  1. 0 39
      src/App.vue

+ 0 - 39
src/App.vue

@@ -19,7 +19,6 @@ export default {
   created() {
   },
   mounted() {
-    this.checkVersion()
     //判断是否在系统更新期间
     var time = new Date(this.$c.updateTime).getTime()
     var time2 = new Date().getTime()
@@ -42,45 +41,7 @@ export default {
     }
   },
   methods: {
-    async checkVersion() {
-      // 1. 加载当前版本号(从本地存储或全局变量)
-      const currentVersion = localStorage.getItem('_APP_VERSION')
 
-      // 2. 定期检查新版本(例如每 5 分钟)
-      setInterval(async () => {
-        try {
-          // 3. 从服务器获取最新版本号(可以是一个 API 或直接加载 version.js)
-          const response = await fetch('/version.js?' + Date.now()); // 加时间戳避免缓存
-          
-          const text = await response.text();
-          
-          // 4. 提取版本号(正则匹配)
-          const match = text.match(/window._APP_VERSION = '([^']+)'/);
-          const latestVersion = match?.[1];
-          // 5. 如果版本不同,提示用户刷新
-          if(latestVersion){
-            if(!currentVersion){
-              localStorage.setItem('_APP_VERSION',latestVersion)
-              currentVersion = latestVersion
-            }else if (latestVersion !== currentVersion) {
-              this.$confirm('新版本已发布, 是否立即刷新?', '更新提示', {
-                  confirmButtonText: '确定',
-                  cancelButtonText: '取消',
-                  showClose:false,
-                  closeOnClickModal:false,
-                  customClass:'update_reminder',
-                  type: 'warning'
-              }).then(() => {
-                localStorage.setItem('_APP_VERSION',latestVersion)
-                window.location.reload()
-              }).catch(() => {
-              });
-            }
-          }
-        } catch (error) {
-        }
-      }, 180000); // 5 分钟检查一次
-    },
   },
 
 }