小程序-用户登录-绑定 报错{"code":1100023,"message":"use wxCode to get user info fail","data":[]}

bug问题 · k0432 · 于 4年前 发布 · 1906 次阅读
wx.request({
      url: app.globalData.urls + "/customer/login/bindaccount",  // "/user/wxapp/login",
      header: app.getPostRequestHeader(),
      method: 'POST',
      data: {
        email: email,
        password: password,
        isBindNew: isBindNew,
      },
      success: function (res) {
        wx.hideLoading();
        app.saveReponseHeader(res);
        if (res.data.code == '1100026') {  // 无法通过微信api获取信息
          wx.showModal({
            title: "提示",
            content: "无法从Session中获取微信Openid,请重新绑定",
            showCancel: false
          });
          that.wxLogin()
          return;
        } else if (res.data.code == '1100027') { // 登陆成功,进行跳转
          wx.showModal({
            title: "提示",
            content: "您已经有绑定的账户",
            showCancel: false
          });
          return;
        } else if (res.data.code == '1100007') { // 没有相关用户,需要绑定
          wx.showModal({
            title: "提示",
            content: "注册账户失败: " + res.data.data.errors,
            showCancel: false
          });

        } else if (res.data.code == '1100029') { // 没有相关用户,需要绑定
          wx.showModal({
            title: "提示",
            content: "该邮箱已经存在,请点击`已有账户`,输入邮箱密码进行账户绑定",
            showCancel: false
          });


        } else if (res.data.code == '1100028') { // 没有相关用户,需要绑定
          wx.showModal({
            title: "提示",
            content: "用户的账户密码不正确,请重新输入",
            showCancel: false
          });
        } else if (res.data.code == '200') { // 没有相关用户,需要绑定
          //wx.navigateTo({
          //  url: "/pages/my/my"
          //})
          wx.navigateBack({
            delta: 1
          });
        } else {
             //出错代码在这里
          wx.showModal({
            title: "提示",
            content: "绑定失败,请重新绑定",
            showCancel: false
          });
          that.wxLogin()
共收到 3 条回复
Fecmall#14年前 0 个赞

2.1.6版本,需要后台设置小程序

Fecmall后台设置的微信小程序appid和appsecret必须和 微信小程序里面设置的一致

https://github.com/fecshop/wx_micro_program/blob/master/project.config.json#L17

另外,小程序也需要做一些设置: http://www.fecmall.com/doc/fecshop-guide/instructions/cn-1.0/guide-fecshop_wx_micro.html

spring0832#24年前 0 个赞

这个问题解决了吗

tonywong#33年前 1 个赞

已解决,请看:http://www.fecmall.com/topic/4672

添加回复 (需要登录)
需要 登录 后方可回复, 如果你还没有账号请点击这里 注册
Your Site Analytics