<button @click="login" type="default" open-type="getUserInfo">登录</button>
login() {
var that = this
uni.getUserProfile({
desc:"weixin", // 指明用途,这个参数是必须的
success:function(res){
console.log(res)
uni.login({
success: async (res) => {
console.log("----------", res);
uni.request({
url: http +`请求地址${res.code}`,
success(res) {
console.log(11, res.data.data.openid)
}
})
},
})
}
})
},
uniapp小程序登录
最新推荐文章于 2024-08-22 17:00:00 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)