chore: input-image 兼容返回字符串 0 的情况 (#3196)

This commit is contained in:
吴多益 2021-12-14 20:52:30 +08:00 committed by GitHub
parent e9a8de5dda
commit 43cad2da60
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -790,7 +790,7 @@ export default class FileControl extends React.Component<FileProps, FileState> {
onProgress
)
.then(ret => {
if (ret.status || !ret.data) {
if ((ret.status && (ret as any).status !== '0') || !ret.data) {
throw new Error(ret.msg || __('File.errorRetry'));
}

View File

@ -1035,7 +1035,7 @@ export default class ImageControl extends React.Component<
const __ = this.props.translate;
this._send(file, this.props.receiver as string, {}, onProgress)
.then((ret: Payload) => {
if (ret.status) {
if (ret.status && (ret as any).status !== '0') {
throw new Error(ret.msg || __('File.errorRetry'));
}