search

Home  >  Q&A  >  body text

javascript - How to obtain openID on H5 page outside WeChat official account?

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?

怪我咯怪我咯2736 days ago1096

reply all(2)I'll reply

  • PHP中文网

    PHP中文网2017-06-28 09:26:06

    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 

    reply
    0
  • 扔个三星炸死你

    扔个三星炸死你2017-06-28 09:26:06

    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

    reply
    0
  • Cancelreply