forked from p96170835/amis
去掉 proxy 地址判断
This commit is contained in:
parent
25d66fd80e
commit
ff8eee9525
|
@ -425,13 +425,7 @@ export default class FileControl extends React.Component<FileProps, FileState> {
|
|||
const fd = new FormData();
|
||||
|
||||
reciever = filter(reciever, this.props.data);
|
||||
|
||||
if (/^\/api\/(?:page\/)?proxy/.test(reciever)) {
|
||||
fd.append('file', file);
|
||||
fd.append('fieldName', config.fieldName);
|
||||
} else {
|
||||
fd.append(config.fieldName || 'file', file);
|
||||
}
|
||||
fd.append(config.fieldName || 'file', file);
|
||||
|
||||
const idx = reciever.indexOf('?');
|
||||
|
||||
|
@ -523,14 +517,7 @@ export default class FileControl extends React.Component<FileProps, FileState> {
|
|||
fd.append('uploadId', state.uploadId);
|
||||
fd.append('partNumber', task.partNumber.toString());
|
||||
fd.append('partSize', task.partSize.toString());
|
||||
|
||||
|
||||
if (/^\/api\/(?:page\/)?proxy/.test(reciever)) {
|
||||
fd.append('file', blob, file.name);
|
||||
fd.append('fieldName', config.fieldName);
|
||||
} else {
|
||||
fd.append(config.fieldName || 'file', blob, file.name);
|
||||
}
|
||||
fd.append(config.fieldName || 'file', blob, file.name);
|
||||
|
||||
return self._send(reciever, fd, {
|
||||
withCredentials: true
|
||||
|
|
|
@ -557,13 +557,7 @@ export default class ImageControl extends React.Component<ImageProps, ImageState
|
|||
const data = this.props.data;
|
||||
reciever = filter(reciever, data);
|
||||
const fileField = this.props.fileField || 'file';
|
||||
|
||||
if (/^\/api\/(?:page\/)?proxy/.test(reciever)) {
|
||||
fd.append('file', file, (file as File).name);
|
||||
fd.append('fieldName', fileField);
|
||||
} else {
|
||||
fd.append(fileField, file, (file as File).name);
|
||||
}
|
||||
fd.append(fileField, file, (file as File).name);
|
||||
|
||||
const idx = reciever.indexOf('?');
|
||||
|
||||
|
|
Loading…
Reference in New Issue