打印出来了 Error: errCode: -501007 invalid parameters | errMsg: cloud path is invalid at new u (eval at n.call.document (runtime.js?devtools_ignore=true:1), <anonymous>:2:233948) at Function.success (eval at n.call.document (runtime.js?devtools_ignore=true:1), <anonymous>:2:285919) at Object.eval [as success] (eval at n.call.document (runtime.js?devtools_ignore=true:1), <anonymous>:2:127441) at y (eval at n.call.document (runtime.js?devtools_ignore=true:1), <anonymous>:2:538311) at v (eval at n.call.document (runtime.js?devtools_ignore=true:1), <anonymous>:2:538549) at eval (eval at n.call.document (runtime.js?devtools_ignore=true:1), <anonymous>:2:540103) at Object.v (eval at n.call.document (runtime.js?devtools_ignore=true:1), <anonymous>:2:77034) at u (runtime.js?devtools_ignore=true:1) at w (runtime.js?devtools_ignore=true:1) at WebSocket.ke.onmessage (runtime.js?devtools_ignore=true:1)
var that = this;
wx.chooseImage({
count: 1,
success: function (res) {
wx.showLoading({
title: '上传中',
})
const filePath = res.tempFilePaths[0]
const tempFile = filePath.split('.')
// 上传图片
const cloudPath = 'my-image' + tempFile[tempFile.length - 2]
wx.cloud.uploadFile({
cloudPath,
filePath,
success: res => {
that.setData({
filePath: res.fileID
})
wx.hideLoading()
}
})
},
})
打印下fail wx.cloud.uploadFile({ cloudPath, filePath, success: res => { that.setData({ filePath: res.fileID }) wx.hideLoading() }, fail: res => { console.error(res) } })
Error: errCode: -501007 invalid parameters | errMsg: cloud path is invalid
at new u (eval at n.call.document (runtime.js?devtools_ignore=true:1), <anonymous>:2:233948)
at Function.success (eval at n.call.document (runtime.js?devtools_ignore=true:1), <anonymous>:2:285919)
at Object.eval [as success] (eval at n.call.document (runtime.js?devtools_ignore=true:1), <anonymous>:2:127441)
at y (eval at n.call.document (runtime.js?devtools_ignore=true:1), <anonymous>:2:538311)
at v (eval at n.call.document (runtime.js?devtools_ignore=true:1), <anonymous>:2:538549)
at eval (eval at n.call.document (runtime.js?devtools_ignore=true:1), <anonymous>:2:540103)
at Object.v (eval at n.call.document (runtime.js?devtools_ignore=true:1), <anonymous>:2:77034)
at u (runtime.js?devtools_ignore=true:1)
at w (runtime.js?devtools_ignore=true:1)
at WebSocket.ke.onmessage (runtime.js?devtools_ignore=true:1)