码迷,mamicode.com
首页 > 微信 > 详细

小程序 用户授权登录

时间:2019-09-06 15:54:41      阅读:129      评论:0      收藏:0      [点我收藏+]

标签:登录   use   func   detail   头像   获取   color   button   user   

1.index.wxml中

<button open-type="getUserInfo" bindgetuserinfo="getUserInfo"> 获取头像昵称 </button>
 
2.index.js中
getUserInfo: function(e) {
  console.log(e)
  app.globalData.userInfo = e.detail.userInfo
  this.setData({
    userInfo: e.detail.userInfo,
    hasUserInfo: true
  })
}

小程序 用户授权登录

标签:登录   use   func   detail   头像   获取   color   button   user   

原文地址:https://www.cnblogs.com/mcll/p/11475033.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!