浏览代码

[Fix 0000] 上传文件报错不全问题修复

houzekong 4 天之前
父节点
当前提交
b2ed14310d
共有 1 个文件被更改,包括 6 次插入6 次删除
  1. 6 6
      src/views/vent/performance/fileDetail/index.vue

+ 6 - 6
src/views/vent/performance/fileDetail/index.vue

@@ -309,14 +309,14 @@
       formData.append('isApprove', formState.isApprove);
       formData.append('fileType', formState.fileType);
       formData.append('filePerm', formState.filePerm);
-      uploadApi(formData)
-        .then(() => {
+      uploadApi(formData).then(({ code, message }) => {
+        if (code !== 200) {
+          createMessage.error(message);
+        } else {
           alive.value = new Date().getTime();
           visible.value = false;
-        })
-        .catch(({ message }) => {
-          createMessage.error(message);
-        });
+        }
+      });
     }
   };
   //取消上传