登录有两种方式,分别是通过open-type=‘getUserInfo’和执行wx.login
这两种方式有什么区别么?
第一种方式:我点击按钮,调用wx.login接口
pages/demo/demo.wxml
<button bindtap="getUserInfo">获取信息</button> |
getUserInfo:function(){ wx.login({ success:(res)=>{ console.log(res) }, fail:(err)=>{ console.log(err) } })} |
第二种方式:通过buttonopen-type="getUserInfo",用户点击同意
<button open-type="getUserInfo" bindgetuserinfo="getInfo">getInfo</button> |

从字面上看就知道完全是不同的东西。