问题如题:
https://ext.dcloud.net.cn/plugin?id=50#rating
用的是官方模板,
send() { //发送反馈
console.log(JSON.stringify(this.sendDate));
let imgs = this.imageList.map((value, index) => {
return {
name: "image" + index,
uri: value
}
})
console.log(imgs);
uni.uploadFile({
url: "https://service.dcloud.net.cn/feedback",
files: imgs,
formData: this.sendDate,
success: (res) => {
if (res.statusCode === 200) {
uni.showToast({
title: "问题反馈成功!"
});
this.imageList = [];
this.sendDate = {
score: 0,
content: "",
contact: ""
}
}
},
fail: (res) => {
uni.showToast({
title: "失败",
icon:"none"
});
console.log(res)
}
});
}
这是执行代码,如果不添加图片,提交反馈报错
[Vue warn]: Error in v-on handler: "TypeError: undefined is not an object (evaluating 'e.indexOf')"
TypeError: undefined is not an object (evaluating 'e.indexOf')
如果添加图片,可以正常反馈,开发者中心能看到用户的反馈信息,但是没有图片
1 个回复
DCloud_UNI_HT
确实是有 bug 稍后会更新插件模板,请注意插件更新,感谢您的反馈