收藏
回答

登录失败,项目之前改过 appid之后 改回来 为啥会登陆失败了?



session.wxlogin().then(res => {
     if (utils.isEmptyObj(res.user)) {
        app.globalData.needReg = true
        $this.showSplash()
    } else {
        try{
        app.globalData.needReg = false
        $this.show()
 
        let id = e.currentTarget.id
 
        let path = "";
        if (id == 'chengzhong') {
            path = '/pages/weight/weight'
        } else if (id == 'dianshu') {
            path = '/pages/count/count'
        }
        wx.switchTab({
            url: path
        })
             
        }catch(e){
            //TODO handle the exception
            wx.showModal({
                title: 'TODO',
                content: 'TODO,TODO'+e
            })
        }
 
 
    }
}).catch(e => {
    console.log(e)
    wx.showModal({
        title: '164',
        content: '164,e'+e.toString()
    })
})
console.log('------------')


回答关注问题邀请回答
收藏

3 个回答

  • 三去云
    三去云
    2019-11-27

    code的问题 检查下代码 是不是哪里改错了

    2019-11-27
    有用 1
    回复 1
    • 忘川
      忘川
      2019-11-27
      对  里面的有个方法是后台接口改了
      2019-11-27
      回复
  • ʚ青ɞ
    ʚ青ɞ
    2019-11-26

    无效的code

    2019-11-26
    有用 1
    回复 3
    • 忘川
      忘川
      2019-11-26
      。。是哪个参数失效了吗
      2019-11-26
      回复
    • ʚ青ɞ
      ʚ青ɞ
      2019-11-26回复忘川
      你传的code是空的
      2019-11-26
      1
      回复
    • 忘川
      忘川
      2019-11-26回复ʚ青ɞ
      奥奥。。谢了
      2019-11-26
      回复
  • 污昂ᰔᩚ王࿐
    污昂ᰔᩚ王࿐
    2019-11-26

    这不够清楚吗?

    2019-11-26
    有用 1
    回复 2
    • 忘川
      忘川
      2019-11-26
      是key失效了吗
      2019-11-26
      回复
    • 污昂ᰔᩚ王࿐
      污昂ᰔᩚ王࿐
      2019-11-26回复忘川
      这个报错说的是code 这个参数为 undefined  看看你wx.login传值哪里吧
      2019-11-26
      1
      回复
登录 后发表内容
问题标签