fix: missing upload headers
This commit is contained in:
parent
17b258e3cc
commit
0902bb5529
@ -194,6 +194,7 @@ export const Upload = connect({
|
|||||||
const [fileList, setFileList] = useState(toFileList(value));
|
const [fileList, setFileList] = useState(toFileList(value));
|
||||||
const uploadProps = {
|
const uploadProps = {
|
||||||
name: 'file',
|
name: 'file',
|
||||||
|
headers: {},
|
||||||
action: `${process.env.API}/attachments:upload`,
|
action: `${process.env.API}/attachments:upload`,
|
||||||
onChange({ fileList }) {
|
onChange({ fileList }) {
|
||||||
console.log(fileList);
|
console.log(fileList);
|
||||||
@ -202,6 +203,10 @@ export const Upload = connect({
|
|||||||
onChange(multiple ? list : list.shift() || null);
|
onChange(multiple ? list : list.shift() || null);
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
const token = localStorage.getItem('NOCOBASE_TOKEN');
|
||||||
|
if (token) {
|
||||||
|
uploadProps.headers['Authorization'] = `Bearer ${token}`;
|
||||||
|
}
|
||||||
const images = getImgUrls(fileList);
|
const images = getImgUrls(fileList);
|
||||||
console.log({ fileList });
|
console.log({ fileList });
|
||||||
return (
|
return (
|
||||||
|
Loading…
Reference in New Issue
Block a user