mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-18 11:18:14 +08:00
remove JSON format limit, close #1248
This commit is contained in:
parent
7faeab678e
commit
fff4e01f14
@ -112,16 +112,11 @@ const AntUpload = React.createClass({
|
|||||||
|
|
||||||
onSuccess(response, file) {
|
onSuccess(response, file) {
|
||||||
this.clearProgressTimer();
|
this.clearProgressTimer();
|
||||||
// 服务器端需要返回标准 json 字符串
|
|
||||||
// 否则视为失败
|
|
||||||
try {
|
try {
|
||||||
if (typeof response === 'string') {
|
if (typeof response === 'string') {
|
||||||
JSON.parse(response);
|
response = JSON.parse(response);
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
this.onError(new Error('No response'), response, file);
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
} catch (e) {/* do nothing */}
|
||||||
let fileList = this.state.fileList;
|
let fileList = this.state.fileList;
|
||||||
let targetItem = getFileItem(file, fileList);
|
let targetItem = getFileItem(file, fileList);
|
||||||
// 之前已经删除
|
// 之前已经删除
|
||||||
|
Loading…
Reference in New Issue
Block a user