Skip to content

Commit 12cfa09

Browse files
committed
fix: upload组件修改文件上传后判断的状态码
在调用uni.uploadFile时,进入success回调函数后根据判断的新增了一个http状态码 201,方便部分服务端根据RESTful api规范设计api
1 parent ead9b90 commit 12cfa09

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

uview-ui/components/u-upload/u-upload.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@
334334
formData: this.formData,
335335
header: this.header,
336336
success: (res) => {
337-
if (res.statusCode != 200) {
337+
if (![200,201].includes(res.statusCode)) {
338338
this.uploadError(index, res.data);
339339
} else {
340340
// 上传成功

0 commit comments

Comments
 (0)