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

藏色散人
Release: 2021-09-06 09:07:24
forward
3753 people have browsed it

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';
Copy after login

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!

Related labels:
source:segmentfault.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template