Browse Source

修复首次访问提示升级的问题

zhontai 2 years ago
parent
commit
d8cd7c6666
1 changed files with 7 additions and 1 deletions
  1. 7 1
      src/App.vue

+ 7 - 1
src/App.vue

@@ -39,7 +39,13 @@ const getVersion = computed(() => {
   let isVersion = false
   if (route.path !== '/login') {
     // @ts-ignore
-    if ((Local.get('version') && Local.get('version') !== __VERSION__) || !Local.get('version')) isVersion = true
+    const currentVersion = __VERSION__
+    const lastVersion = Local.get('version')
+    if (!lastVersion) {
+      Local.set('version', currentVersion)
+    } else if (lastVersion !== currentVersion) {
+      isVersion = true
+    }
   }
   return isVersion
 })