wx.cloud.CDN中写filePath: res.tempFilePaths,会报错:Error: cloud.callFunction:fail undefined . uploadToCommonCDN:fail e.replace is not a function
但如果直接写地址filePath: "http://tmp/gZyPniZcHkHod7cccc7faaf5d114fdb2a6ad6dcac05f.jpeg",可以正常返回结果
代码如下:
wx.chooseImage({
count: 1,
sizeType: ['compressed'],
sourceType: ['album', 'camera'],
success (res) {
console.log(res.tempFilePaths)
wx.cloud.callFunction({
name:'ocrIdcard',
data: {
imgUrl: wx.cloud.CDN({
type: 'filePath',
filePath: res.tempFilePaths,
})
},
complete:res=>{
console.log(res)
}
})
请各位大佬帮忙看看是哪里有问题啊?
你传的是数组啊 大佬,能不能认真点啊