使用小程序自带的
wx.request()提交,(带文件-图片),用get提交的时候拦截器中无法get到请求的参数,改回POST提交可以正常获取参数,但是报以下错误,接收文件是用
List<UploadFile> listFile = getFiles();
java.lang.RuntimeException: java.io.IOException: Separation boundary was not specified
at com.jfinal.upload.MultipartRequest.wrapMultipartRequest(MultipartRequest.java:126)
at com.jfinal.upload.MultipartRequest.<init>(MultipartRequest.java:68)
.....................................
小程序:
wx.request({
url: util.testUrl + 'wxmall-web-applet/wxPdReview/saveReview',
method: 'GET',
header: {
"Content-Type": "multipart/form-data",
'accept': 'application/json',
},
data: {
from_t:1,
name:uploadImages,
order_id: 19,
product_id: 37,
score: scoreValue,
content: contentValue,
param: aesV,
authToken: token,
},
success: function (res) {
if(res.data.code == 0){
util.showToast('提交失败请重试', 'error');
return false;
}else{
}
console.log(res)
},
fail: function (res) {
console.log(res)
},
complete: function (res) {
console.log(res)
}
})
在线等指教,谢谢!