Commit dbbda77f authored by Bill's avatar Bill

fix: 上传token 问题

parent ae8a8eef
......@@ -40,7 +40,7 @@
}
.error {
color: '#ff4d4f';
color: #ff4d4f;
}
> a {
......
......@@ -2,7 +2,7 @@ import React, { useEffect, useState } from 'react';
import cx from 'classnames'
import { UploadProps, UploadChangeParam, UploadFile } from 'antd/lib/upload/interface'
import { UPLOAD_TYPE } from '@/constants';
import { Upload, Progress, Button } from 'antd';
import { Upload, Progress, Button, message } from 'antd';
import { CloudUploadOutlined, DeleteOutlined } from '@ant-design/icons';
import styles from './UploadFiles.less';
import pdf_icon from '@/assets/imgs/pdf_icon.png';
......@@ -62,6 +62,10 @@ const UploadFiles: React.FC<PickUploadProps> = (props: PickUploadProps) => {
// disabled: loading || disabled,
showUploadList: false,
onChange(info: UploadChangeParam) {
if(info.file.status === 'error') {
message.error("上传失败, 请检查上传接口");
}
// 如果不存在fileList, 只存在onChange 那么也要改变组件的file
if (!("fileList" in props)) {
setFiles(info.fileList);
......@@ -86,7 +90,6 @@ const UploadFiles: React.FC<PickUploadProps> = (props: PickUploadProps) => {
setFiles(newFileList);
}
}
const renderFileItem = () => {
return (
<div className={filesContainerCs}>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment