wx.uploadFile一直失败,是url的原因吗?

发布于 6 年前作者 yangmao14459 次浏览最后编辑 6 年前来自 issues
              wx.uploadFile({
                url: 'http://localhost:8080/xxx/v1/feedback',
                filePath: tempFilePaths,
                name: 'file',                
                header: {
                  'Content-Type': 'multipart/form-data',
                  'accept': 'application/json',
                },
                success:function(res){
                  console.log("上传成功");
                },
                fail:function(res){
                  console.log("上传失败");
                }
              })

filePath调试可以看到没问题,是url的原因吗,一直是上传失败。后台也完全没有接到请求。

1 回复
na37
na371 楼4 年前
tempFilePaths是数组不是字符串。已解决