Home >PHP Framework >ThinkPHP >Solve the problem of 10003 error when TP obtains WeChat user information

Solve the problem of 10003 error when TP obtains WeChat user information

藏色散人
藏色散人forward
2021-09-03 15:35:343773browse

thinkphp The framework tutorial column will introduce to you how to solve the 10003 error problem when TP obtains WeChat user information. I hope it will be helpful to friends in need!

Solve the problem of 10003 error when TP obtains WeChat user information

  • Obtaining user information, no error is reported on the PC side, only an error is reported on the WeChat side. At first, I thought it was a problem on the WeChat side.

  • I have been searching online for a long time and they all said it was because the oauth2 domain name added http, but the fact is that my own project did not add it.

  • Later, I finally saw a few different answers. I tried to change them and finally succeeded. WeChat no longer reported this error. Let me share it with you!

Solve the problem of 10003 error when TP obtains WeChat user information

If you have confirmed that your oauth2 authorization url does not add http,
Please check that your redirect_uri has There is no http in front of the domain name! ! !
The code is as follows:

// 一定要检查你的redirect_uri
$redirect = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=你的appID&redirect_uri=http://你的域名/get?id=18&response_type=code&scope=snsapi_base&state=1&connect_redirect=1#wechat_redirect';

Then, the problem is solved! I have been troubled for a long time and finally found that the solution is actually very simple. I hope it can help everyone.

Recommended: "The latest 10 thinkphp video tutorials"

The above is the detailed content of Solve the problem of 10003 error when TP obtains WeChat user information. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:segmentfault.com. If there is any infringement, please contact admin@php.cn delete