当前位置:网站首页>微信小程序getPhoneNumber接口code=40013
微信小程序getPhoneNumber接口code=40013
2022-08-09 13:21: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保持一致即可
边栏推荐
- 12. cuBLAS Development Guide Chinese version--Level-1 functions asum() and axpy() in cuBLAS
- Jetpack Compose - simply the basic attributes of Modifier is introduced
- 群组行动控制--自动队列化实现策略
- pytest 之 fixture参数化
- Q_04_05 使用Qubits
- 记一次 ERROR scheduler.AsyncEventQueue: Dropping event from queue shared导致OOM
- 对百度的内容进行修改
- 学习opencv-基础应用
- 关于做2D游戏时,Canvas边界显示在Game窗口的问题
- 响应式pbootcms模板家禽饲养类网站
猜你喜欢
随机推荐
Badge of openharmony container components
VNet
pytest 之 fixture参数化
客户端连接rtsp的步骤
从房产中介到程序员--80后张江男
C#使用cersharp
Q_04_04 Q#类型模型
缓存和数据库一致性问题
ttemp
行程和用户[阅读理解法]
opencv-matchTemplate 之使用场景为大图里面找小图
FFMPEG multimedia file processing (deletion and renaming of ffmpeg files)
数据增广
音频基础学习——声音的本质、术语与特性
Jetpack Compose - the use of Image (picture)
mmdetction
11. cuBLAS Development Guide Chinese version--Level-1 functions amax() and amin() in cuBLAS
FFmpeg av_interleaved_write_frame错误
RobotFramework 之 数据驱动
RobotFramework 之 RF变量与标准库关键字使用