AI助手支持GPT4.0
小程序登录、用户信息相关接口调整后wx.getUserInfo接口可以直接调用吗?Can the wx.getUserInfo interface be called directly after the small program login and user information related interfaces are adjusted?
小程序登录、用户信息相关接口调整后wx.getUserInfo接口可以直接调用吗?
如题,调整前的wx.getUserInfo接口只能通过用户点击按钮来触发
<Button open-type='getUserInfo' onGetUserInfo={this.handleConfirm} >授权获取用户信息</Button>
调整后是否可以直接调用
wx.getUserInfo({ success (res) { console.log('getUserInfo res', res) } })
我在本地调试工具中试了下,截止到2021-03-09应该还不能直接调用,还是需要点击按钮触发(指定open-type)。是不是在2021年4月13日后wx.getUserInfo接口就可以直接调用了?
建议可以直接调用,不依赖用户点击按钮触发,否则调整后如果要同时获取用户的openId和真实昵称,那么还得让用户点击按钮调用getUserProfile接口
Before adjustment wx.getUserInfo The interface can only trigger < button open type = getUserInfo 'ongetuserinfo' by clicking the button={ this.handleConfirm }> authorization to obtain user information < / button > can it be directly called after adjustment wx.getUserInfo ({ success (res) { console.log ('getUserInfo res', res) } }) I tried in the local debugging tool. As of March 9, 2021, it should not be called directly, or it needs to be triggered by clicking the button (specify open type). Is it after April 13, 2021 wx.getUserInfo Interface can be called directly? It is recommended that it can be called directly without the user clicking the button to trigger. Otherwise, if you want to get the user's openid and real nickname at the same time after adjustment, you have to let the user click the button to call the getuserprofile interface
一定需要用户点击触发