如果是 api/proxy 则由后端实现

This commit is contained in:
liaoxuezhi 2019-06-26 11:15:11 +08:00
parent 093f6789b8
commit 2621fe736e
1 changed files with 8 additions and 1 deletions

View File

@ -558,7 +558,14 @@ export default class ImageControl extends React.Component<ImageProps, ImageState
const data = this.props.data;
reciever = filter(reciever, data);
const fileField = this.props.fileField || 'file';
fd.append(fileField, file, (file as File).name);
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);
}
const idx = reciever.indexOf('?');
if (~idx && params) {