浏览代码

修改bug

bill 2 年之前
父节点
当前提交
727c0eed39
共有 1 个文件被更改,包括 7 次插入2 次删除
  1. 7 2
      src/views/example/files/list.tsx

+ 7 - 2
src/views/example/files/list.tsx

@@ -151,6 +151,11 @@ export const AddExampleFile = (props: AddExampleFileProps) => {
   const onFinish = async (values: any) => {
     if (!values.filesUrl.fileList.length) {
       message.error('附件文件不能为空!')
+      return;
+    }
+    if (values.filesUrl.file?.error?.message) {
+      message.error(values.filesUrl.file?.error?.message)
+      return;
     }
     await addExampleFile({
       ...values,
@@ -164,7 +169,7 @@ export const AddExampleFile = (props: AddExampleFileProps) => {
   const onSubmit = () => {
     from.current?.submit()
   }
-  const accpets = [".pdf", ".word", ".jpg"]
+  const accpets = [".pdf", ".doc", ".docx", ".jpg"]
 
   const uploadProps: UploadProps = {
     async customRequest(option) {
@@ -194,7 +199,7 @@ export const AddExampleFile = (props: AddExampleFileProps) => {
 
   return (
     <Modal 
-      width="400px"
+      width="500px"
       title="上传附件" 
       visible={true} 
       onOk={onSubmit}