1.首先需要获取code

使用

          wx.login({
            success: function(res) {
              console.log(res);//这里的返回值里面便包含code
            },
            fail: function(res) {
              console.log('登陆失败');
            },
            complete: function(res) {},
          })

 

获取到code以后,将code发送给自己的后台 便可以获取到openid了

相关文章:

  • 2021-12-18
  • 2022-12-23
  • 2021-12-05
  • 2021-11-28
  • 2021-04-14
猜你喜欢
  • 2021-07-13
  • 2022-02-06
  • 2021-12-05
  • 2022-12-23
  • 2021-12-05
相关资源
相似解决方案