收藏
回答

今天这个api没有反应,我通过console.log打桩,出来了,api没反应

框架类型 问题类型 API/组件名称 终端类型 微信版本 基础库版本
小程序 Bug wx.getUserProfile 微信安卓客户端 找不到 androdid9 wechat 8.0.15.2020

  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 个回答

  • Cjiang
    Cjiang
    2021-11-25

    fail 回调返回什么信息呢?

    2021-11-25
    有用
    回复
  • 迪克
    迪克
    2021-11-25

     fail: (res) => { 

    console.log(res);

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

    }


    看看 fail 返回什么

    2021-11-25
    有用
    回复
登录 后发表内容