xiaohaizhao 2 miesięcy temu
rodzic
commit
ee25ef2b54
1 zmienionych plików z 7 dodań i 3 usunięć
  1. 7 3
      utils/Http.js

+ 7 - 3
utils/Http.js

@@ -17,9 +17,13 @@ class HTTP {
       getList();
     }
     this.getSpecifiedImage = function (obj, getType = false) {
-      let type = getType ? "compressed" : "thumbnail";
-      let imgObj = obj.subfiles.find((v) => v.type == type);
-      return imgObj?.url;
+      try {
+        let type = getType ? "compressed" : "thumbnail";
+        let imgObj = obj.subfiles.find((v) => v.type == type);
+        return imgObj?.url;
+      } catch (error) {
+        return obj.url;
+      }
     }
 
     // 请求拦截器