收藏
回答

原本的项目打包发给别人,后面重新导入就出现这样的问题,换了appid?请问各位大佬们怎么办?

代码段:

getOpenId(e) {

    let that = this;

    if(that.data.name == "" || that.data.num == ""{

      wx.showModal({

        title: '提示',

        content: '请检查姓名和学号',

        showCancel:false,

        confirmText:"晓得啦~",

        success: function (res) {

            if (res.confirm{

                console.log('用户点击确定')

            }else{

               console.log('用户点击取消')

            }

        }

      })

      return  

    }

    

    wx.showLoading({

      title: '',

    })

    let cloudID = e.detail.cloudID

    wx.cloud.callFunction({

        name:'getopenid',

        data:{

          cloudID:wx.cloud.CloudID(cloudID)

        }

    }).then(res=>{  

      db.collection('student').where({

        openid: res.result.event.userInfo.openId

      }).get({success:dat => {

            console.log("res")

            console.log(dat.data.length)

            ifdat.data.length == 0){

              that.adduser(res)

            }else{

              wx.showModal({

                title: '提示',

                content: '你已经填写过信息啦~',

                showCancel:false,

                confirmText:"晓得啦~",

                success: function (res) {

                    if (res.confirm{

                        console.log('用户点击确定')

                    }else{

                       console.log('用户点击取消')

                    }

                }

             })

            }

         }

      })

      

      wx.hideLoading({

        success: (res) => {},

      })

    })

  },


回答关注问题邀请回答
收藏
登录 后发表内容