<button open-type="getUserInfo" @getuserinfo="getUserInfo">登录</button>
  methods: {
    getUserInfo: function(e) {
    console.log(e) wx.setStorageSync(
"nickname", e.mp.detail.userInfo.nickName); wx.setStorageSync("avatarUrl", e.mp.detail.userInfo.avatarUrl); }, login() { if (!wx.getStorageSync("nickname")) { wx.login({ success: function(res) {
        console.log(res)
      } }); } } }, created() {
this.login(); },

 

相关文章:

  • 2021-12-18
  • 2022-12-23
  • 2022-12-23
  • 2021-12-05
  • 2021-11-28
猜你喜欢
  • 2021-11-28
  • 2021-11-28
  • 2022-12-23
  • 2021-12-05
相关资源
相似解决方案