新用户在getUserProfile的弹窗允许后能否直接调用getUserInfo接口?

小程序 文章 2021-04-01 13:42 651 0 全屏看文

AI助手支持GPT4.0

新用户在getUserProfile的弹窗允许后能否直接调用getUserInfo接口?Can a new user directly call the getUserInfo interface after the pop-up window of getUserProfile allows it?

新用户在getUserProfile的弹窗允许后能否直接调用getUserInfo接口?

js代码片段如图

wxml文件写法<button bindtap="getUserProfileclass='authBtnlang='zh_CN'>{{chance_yes}}</button>,用这种写法弹窗点击允许getUserInfo接口会报错getUserInfo:fail scope unauthorized

wxml文件写法<button bindtap="getUserProfileclass='authBtnopenType='getUserInfolang='zh_CN'>{{chance_yes}}</button>,用这种写法第一次点击弹窗允许时,两个接口都没有返回信息控制台除了1111111111没有任何东西。只有当第二次点击按钮弹窗并允许时,才会正常返回。

因为业务需求,两个接口都需要调用,如何让新用户只授权一次,就能使两个接口都返回

JS code fragment is as shown in the figure, wxml file writing < button bindtap = "getuserprofile" class = - authbtn 'lang = - zh_ CN'>{{chance_ Yes} < / button >, in this way, clicking the getUserInfo interface in the pop-up window will report an error tUserInfo:fail scope The writing method of unauthorized wxml file_ CN'>{{chance_ Yes} < / button >, in this way, when you click the pop-up window for the first time, neither of the two interfaces returns to the information console, and there is nothing except 1111. Only when you click the button pop-up for the second time and allow it, will you return normally. Because of business requirements, both interfaces need to be called. How to make a new user authorize only once to make both interfaces return

回答:

Brother斌🎈:

业务不需要,旧getUserInfo所需要的东西可以根据wx.login和wx.getUserProfile获取到

维她命系:

为什么要一起调用?

-EOF-

AI助手支持GPT4.0


国内超级便宜服务器

摸鱼人热门新闻聚合

钻级赞助商 我要加入

开发者在线工具

第三方支付技术请加QQ群

相关文章
公众号注销找不到注册人怎么注销?
onShareAppMessage能否支持点击分享内容跳到另外一个小程序?
小程序 chooseImage api 失效?
wxml不能抛出错误?
小程序的人力资源经营许可证可否是授权使用的?
随便看看
微信开放平台跟公众平台有什么区别? 3608
怎么添加小程序支付功能? 4516
教育科技公司申请微信支付被拒绝? 4798
微信公众号免300认证教程 5892
小程序已经上线,作为管理员无法在小程序数据助手查看数据? 5299
小程序广告组件通过审核,但是小程序内没有显示广告? 5067
企业微信通讯录账号被管理员误/恶意删除,怎么办? 9568
问题? 9048
如何快速搭建抽奖助手小程序(无需代码知识) 6177
许涛 大哥在吗, 要解冻小程序的时候提示信息主体不一致, 能帮忙看下吗? 7472