Browse Source

修改bug

bill 2 years ago
parent
commit
727c0eed39
1 changed files with 7 additions and 2 deletions
  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}