javascript - How to obtain openID on H5 page outside WeChat official account?
怪我咯
怪我咯 2017-06-28 09:24:06
0
2
1059

To develop a service account public account, configure the menu, click the menu to enter the H5 page, and you can silently authorize and get the openID. The problem is, there is another requirement: scan the code to enter a certain menu H5 page (not through the public account, so If you have not entered the official account), you cannot get openID at this time. What is the reason? Is it because you cannot get openID outside the WeChat official account?

怪我咯
怪我咯

走同样的路,发现不同的人生

reply all(2)
Ty80

Your menu obtains openID through "WeChat webpage authorization", right? Just make the same URL as the menu into a QR code. For example, the URL in the following format:

https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx520c15f417810387&redirect_uri=https%3A%2F%2Fchong.qq.com%2Fphp%2Findex.php%3Fd%3D%26c%3DwxAdap
ter%26m%3DmobileDeal%26showwxpaytitle%3D1%26vb2ctag%3D4_2030_5_1194_60&response_type=code&scope=snsapi_bas
e&state=123#wechat_redirect 
扔个三星炸死你

If you scan the QR code or click on the shared link, there will be no silent authorization. To change it to userinfo authorization, the user needs to manually click to agree

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!