调用wx.cloud.uploadFile,报错wx is not define是为什么呢?

小程序 文章 2022-02-20 02:40 776 0 全屏看文

AI助手支持GPT4.0

调用wx.cloud.uploadFile,报错wx is not define是为什么呢?When calling wx.cloud.uploadFile, why is the error wx is not define reported?

调用wx.cloud.uploadFile,报错wx is not define是为什么呢?
myuploadFile(tempFilePath,successUp,failUp,i,length){        wx.cloud.uploadFile({            cloudPath:'filebase_app/'+new Date()+'/'+tempFilePath[i].name,            filePath:tempFilePath[i].path,            success:(res)=>{                successUp++                console.log(res.data)            },            fail:(err)=>{                failUp++                console.log(err)            },            complete:()=>{                i++                if(i==length){                    wx.showToast({                      title: successUp+'份上传完成',                    })                }                else{                    // this.myuploadFile(tempFilePath,successUp,failUp,i)                }            }        })    },

myuploadFile(tempFilePath,successUp,failUp,i,length){        wx.cloud.uploadFile({            cloudPath:'filebase_app/'+new Date()+'/'+tempFilePath[i].name,            filePath:tempFilePath[i].path,            success:(res)=>{                successUp++                console.log(res.data)            },            fail:(err)=>{                failUp++                console.log(err)            },            complete:()=>{                i++                if(i==length){                    wx.showToast({                      title: successUp+'份上传完成',                    })                }                else{                    // this.myuploadFile(tempFilePath,successUp,failUp,i)                }            }        })    },

回答:

吉💯:小程序被骗钱,小程序平台是不管的吗?
微盟:

在上面console看下wx对象呢?如果没有的话尝试传进这个方法里呢?

墨迹:

uploadfile的filepath参数访问临时地址时导致wx is not define

目前不知道原因

-EOF-

AI助手支持GPT4.0