فهرست منبع

upload paper md

zhangjie 5 سال پیش
والد
کامیت
afa6dd335d

+ 2 - 2
src/modules/exam-center/components/UploadFileView.vue

@@ -157,7 +157,7 @@ export default {
         msg: content
       };
       this.loading = false;
-      this.$emit("upload-error", content);
+      this.$emit("upload-error", this.res);
     },
     handleExceededSize() {
       const content =
@@ -167,7 +167,7 @@ export default {
         msg: content
       };
       this.loading = false;
-      this.$emit("upload-error", content);
+      this.$emit("upload-error", this.res);
     },
     setAttachmentName(name) {
       this.attachmentName = name;

+ 5 - 2
src/modules/exam-center/components/UploadPaperDialog.vue

@@ -15,7 +15,7 @@
         <el-form-item label="试卷文件:">
           <upload-file-view
             input-width="270px"
-            :format="['doc', 'docx']"
+            :format="['doc', 'docx', 'pdf']"
             :upload-url="uploadUrl"
             @upload-error="uplaodError"
             @upload-success="uploadSuccess"
@@ -63,7 +63,10 @@ export default {
     },
     // upload-handler
     uplaodError(errorData) {
-      this.$notify.error({ title: "错误提示", message: errorData.message });
+      this.$notify.error({
+        title: "错误提示",
+        message: errorData.message || errorData.msg
+      });
     },
     uploadSuccess(res) {
       this.$message.success("上传成功!");