微信小程序调用api接口


请求的第三方微信url大概有3种

1)$url = "https://api.weixin.qq.com/sns/oauth2/access_token?appid=$appid&secret=$appsecret&code=$code&grant_type=authorization_code";

2)$url = "https://api.weixin.qq.com/sns/oauth2/component/access_token?appid=$appid&secret=$appsecret&code=$code&grant_type=authorization_code";

3)$url = "https://api.weixin.qq.com/sns/jscode2session?appid=$appid&secret=$appsecret&js_code=$code&grant_type=authorization_code";

注意:小程序获取openid的接口和网页授权的不一样。

貌似之前申请的小程序可以用网页授权的接口。

最近注册的小程序会报api unauthorized

第一种最近貌似也会报api unauthorized


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM