Pārlūkot izejas kodu

接口报错和版本一致不弹Confirm

lifanagju_citu 6 mēneši atpakaļ
vecāks
revīzija
4c8f570f22
1 mainītis faili ar 2 papildinājumiem un 1 dzēšanām
  1. 2 1
      src/App.vue

+ 2 - 1
src/App.vue

@@ -37,7 +37,8 @@ const checkVersion = () => {
     headers: { ['tenant-id']: tenantId },
     headers: { ['tenant-id']: tenantId },
     cache: 'no-store' // 禁用缓存
     cache: 'no-store' // 禁用缓存
   }).then((res) => {
   }).then((res) => {
-    if (res?.data?.data === version) {
+    // 接口报错和版本一致不弹Confirm
+    if (!res?.data?.data || res.data.data === version) {
       return
       return
     }
     }
     if (ConfirmDone) {
     if (ConfirmDone) {