diff --git a/src/components/AiUploader.vue b/src/components/AiUploader.vue index 98017f6e..1e01abe9 100644 --- a/src/components/AiUploader.vue +++ b/src/components/AiUploader.vue @@ -121,11 +121,9 @@ export default { uni.showLoading({title: '上传中'}) let formData = new FormData() formData.append('file', img) - this.$http - .post(this.action, formData, { + this.$http.post(this.action, formData, { params: {type: this.type}, - }) - .then((res) => { + }).then((res) => { uni.hideLoading() if (res?.data) { this.$emit('data', res.data) @@ -144,8 +142,10 @@ export default { } else { this.$u.toast(res.msg) } + }).catch(err => { + this.$u.toast(err) + uni.hideLoading() }) - .catch(() => uni.hideLoading()) }, handleReUpload(i) { this.upload(() => this.remove(i))