소스 검색

[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);
-        });
+        }
+      });
     }
   };
   //取消上传