当前位置:网站首页>微信小程序getPhoneNumber接口code=40013
微信小程序getPhoneNumber接口code=40013
2022-08-02 12:49:00 【·码上修·】
记录一个开发过程中碰到的一个问题,通过getPhoneNum接口去获取用户手机号,微信返回了
code=40013, msg=invalid appid
获取微信手机号失败, code=40013, msg=invalid appid
无效的appid,然后去查看官方接口文档,发现并没有让我们传appid
phonenumber.getPhoneNumber | 微信开放文档
但是让我们传了一个接口调用凭证access_token,我们获取这个凭证的时候是要传appId的
还有一个参数code,这个code是小程序端通过wx.login接口获取,微信小程序自己有个appid,如果我们获取调用凭证时用的appid跟小程序用的appid不同,获取手机好的时候就会返回40013,无效的appId,俩个appId相同即可
边栏推荐
猜你喜欢
随机推荐
js真3d柱状图插件
pytorch model to tensorflow model
Taurus.MVC V3.0.3 微服务开源框架发布:让.NET 架构在大并发的演进过程更简单。
There are several ways to jump to js source code, jump on the current page, jump on the blank page
Object.entries()
LeetCode_139_word split
ssm access database data error
js cool dashboard plugin
photo-sphere-viewer Chinese documentation
路由-嵌套路由
MyCat2 introduction and installation and basic use
Import and export data of SQL Server database
Manual architecture, Mysql interview 126 questions
The 7 most commonly used data analysis thinking, solve 95% of the analysis problems
numpy&pands 中的unique
js秒表倒计时插件
Speed up your programs with bitwise operations
php - the first of three solid foundations
智能手表前景如何?
Openlayers Quick Start Tutorial