去掉 proxy 地址判断

This commit is contained in:
liaoxuezhi 2019-07-27 21:21:54 +08:00
parent 25d66fd80e
commit ff8eee9525
2 changed files with 3 additions and 22 deletions

View File

@ -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

View File

@ -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('?');