uniapp支付宝小程序授权-踩坑
对着支付宝官方文档应该这么写,但是实际发现授权确定按钮点击后无法回调进入onGetAuthorize
<button @onGetAuthorize="onGetAuthorize" scope="userInfo" open-type="getAuthorize" class="login">
onGetAuthorize(res) { my.getOpenUserInfo({ fail: (res) => {}, success: (res) => { let userInfo = JSON.parse(res.response).response // 以下方的报文格式解析两层 response console.log(userInfo); my.alert({ content: userInfo }); }, }); },
后来发现可以进入回调getAuthorize
<button @getAuthorize="onGetAuthorize" scope="userInfo" open-type="getAuthorize" class="login">授权登录</button>