今天这个api没有反应,我通过console.log打桩,出来了,api没反应
发布于 5 年前 作者 majuan 6878 次浏览 来自 官方Issues

  console.log(123)

    let that = this;

    wx.getUserProfile({

      desc: "用于完善用户个人资料,开放功能权限!",

      success: function (res) {

        let { encryptedData, iv, userInfo } = res;

        wx.cloud.callFunction({

          name: "healthweb",

          data: { type: 'quickLogin', encryptedData, iv, userInfo },

          success: res => {

            let { data } = res.result;

            app.globalData["_user"] = data[0];

            app.globalData["_userState"] = data.length == 1;

            if (data.length == 1) {

              let { actions } = that.data,

                { _user } = app.globalData,

                { nickName, avatarUrl } = _user;

              actions[0] = { name: "微信快捷登录", disabled: true }

              that.setData({ avatar: { nickName, avatarUrl }, actions });

              Notify({ type: "success", message: nickName + " 登录成功!" })

            }

          },

          fail: () => wx.$error("快捷登录失败!")

        })

      }

    })

    console.log(456)

2 回复

fail 回调返回什么信息呢?

 fail: (res) => { 

console.log(res);

wx.$error(“快捷登录失败!”);

}

看看 fail 返回什么

回到顶部