This commit is contained in:
lyp 2025-03-05 01:20:35 +08:00
parent fe72f02095
commit 9ffeb62911

View File

@ -621,20 +621,25 @@ export default function Payment(props: IPaymentProps) {
}} }}
rules={[{ required: true, message: '请上传打款凭证' }]} rules={[{ required: true, message: '请上传打款凭证' }]}
> >
<Upload name="image" <div style={{
maxCount={2} width: '200px',
action={uploadImageUrl()} overflow: 'hidden',
headers={{ 'X-USER-ID': DevUserId }} }}>
beforeUpload={(file: FileType) => { <Upload name="image"
const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png'; maxCount={2}
if (!isJpgOrPng) { action={uploadImageUrl()}
message.error('只能上传 JPG/PNG 格式文件!'); headers={{ 'X-USER-ID': DevUserId }}
} beforeUpload={(file: FileType) => {
return isJpgOrPng; const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png';
}} if (!isJpgOrPng) {
> message.error('只能上传 JPG/PNG 格式文件!');
<Button icon={<UploadOutlined />}></Button> }
</Upload> return isJpgOrPng;
}}
>
<Button icon={<UploadOutlined />}></Button>
</Upload>
</div>
</Form.Item> </Form.Item>
</td> </td>
</tr> </tr>