0
点赞
收藏
分享

微信扫一扫

小程序 用户授权获得用户信息

李雨喵 2022-02-05 阅读 53

小程序官网:https://developers.weixin.qq.com/miniprogram/dev/framework/quickstart/getstart.html

wxml:

 <button class="confirm-btn" catchtap="login">授权登录</button>

js:

 login:function () {
      wx.getUserProfile({
        desc:'正在获取',//不写不弹提示框
        success:function(res){
          console.log('获取成功: ',res)
        },
        fail:function(err){
          console.log("获取失败: ",err)
        }
    })
  }

在这里插入图片描述

举报

相关推荐

0 条评论