getuserphonenumber获取手机号接口真机可用,发布后报错?

小程序 文章 2022-01-05 19:40 9 0 全屏看文

getuserphonenumber获取手机号接口真机可用,发布后报错?The getuserphonenumber interface is available on the real device, and an error is reported after the release?

getuserphonenumber获取手机号接口真机可用,发布后报错?

通过点击button按钮获取手机号,先用https://api.weixin.qq.com/cgi-bin/token接口获取access_token,再用https://api.weixin.qq.com/wxa/business/getuserphonenumber接口获取手机号。

开发者工具不可行getPhoneNumber,拿到的e.detail.code获取不到code;

真机测试可行,都可以走通。

发布后不可行,提示https://api.weixin.qq.com/wxa/business/getuserphonenumber接口不在域中fail url in domain list。

(第一个接口为token,第二个接口为getuserphonenumber

但是又不能配置在服务器域名中。

请问有人解决过这个问题么?或者官方大大给个解决方式,谢谢了



Click the button to get the mobile phone number. First use the https://api.weixin.qq.com/cgi-bin/token Interface to get access_ Token, and then https://api.weixin.qq.com/wxa/business/getuserphonenumber Interface to get the phone number. The developer tool is not feasible. Getphonenumber, e.detail Code cannot get code; The real machine test is feasible and can go through. It is not feasible after publishing, prompt https://api.weixin.qq.com/wxa/business/getuserphonenumber Interface is not in domain. Fail URL in domain list. (the first interface is token and the second interface is getuserphonenumber) but it cannot be configured in the server domain name. Has anyone solved this problem? Or the official will give a solution. Thank you

回答:

圣殿骑士:

不能直接请求 weixin的api啊

要通过后端兑换下的,后端帮你调用微信的api

码龙:多谢,我去试下
拾忆:

码龙:好的多谢
一壶炊烟煮黄昏:

想知道 这个 api哪里找到的。

https://api.weixin.qq.com/wxa/business/getuserphonenumber

码龙:小程序API文档里面

-EOF-