
wxml:
<button class='apply-btn' bindtap="login" type='primary'>
授权
</button>
js:
Page({
async login(){
try{
let res = await wx.getUserProfile({
desc: '用于获取用户信息',
})
console.log("授权成功:",res)
}catch(err){
}
}
})

博客围绕小程序开发,以【面向公告编程】的方式,深入分析适配 wx.getUserProfile,同时探讨了如何兼容 wx.getUserInfo,涉及 wxml 和 js 相关内容。
370

被折叠的 条评论
为什么被折叠?



