This article mainly shares with you how to obtain openid on WeChat. First of all, it must be clear that if you want user authorization, you need to guide the user to your authorization page.
1. You must have a link
https://open.weixin.qq.com/connect/oauth2/authorize?appid=APPID&redirect_uri=URI&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect
Instructions:
APPID is your WeChat official account ID, starting with wx
URI is your authorization entrance, usually under the main domain name pointed to by the WeChat official account. I put it here: http://www.xxoo.com/home/index/test
Pay attention to escaping, so URI=http%3A%2F%2Fwww.xxoo.com%2Fhome%2Findex% 2Ftest
2. This link can generate a QR code for others to scan. For example, go to this website: https://cli.im/
and fill in the link replaced above, and the generated code will be generated. Can.
3. Get the openid code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
|
This way you can identify each WeChat user by getting the openid.
Related recommendations:
How to obtain openid and user information in WeChat mini program
A case of obtaining session_key and openid in WeChat mini program (Picture)
The above is the detailed content of How to get openid on WeChat. For more information, please follow other related articles on the PHP Chinese website!