feat(component): 为文件上传添加授权头

master
钟良源 2 months ago
parent 3a3333c40e
commit 6450b05a56

@ -1,4 +1,5 @@
import React, { useEffect, useState, useRef, useCallback } from 'react'; import React, { useEffect, useState, useRef, useCallback } from 'react';
import { getToken } from '@/utils/auth';
import { import {
Modal, Modal,
Form, Form,
@ -502,6 +503,7 @@ const AddComponentModal = ({ visible, baseInfo, setVisible, onReFresh, mode = 'c
return ( return (
<Upload <Upload
action="/api/v1/bpms-workbench/fileSystem/fileUpload" action="/api/v1/bpms-workbench/fileSystem/fileUpload"
headers={{ Authorization: getToken() }}
fileList={file ? [file] : initialImageUrl ? [{ url: initialImageUrl, status: 'done' }] : []} fileList={file ? [file] : initialImageUrl ? [{ url: initialImageUrl, status: 'done' }] : []}
showUploadList={false} showUploadList={false}
onChange={(_, currentFile: any) => { onChange={(_, currentFile: any) => {

Loading…
Cancel
Save