Home  >  Article  >  Backend Development  >  ajax and WeChat authorization to obtain user basic information

ajax and WeChat authorization to obtain user basic information

WBOY
WBOYOriginal
2016-12-05 13:44:301711browse

Thinkphp project, I want to enable users to click a button to determine whether they are logged in through ajax (openid in the session means logged in status). If they are not logged in, they will be guided to the authorization page. After authorization, how can they return to the original page to execute the remaining business logic? Is it true that WeChat authorization cannot be achieved through ajax?

Reply content:

Thinkphp project, I want to enable users to click a button to determine whether they are logged in through ajax (openid in the session means logged in status). If they are not logged in, they will be guided to the authorization page. After authorization, how can they return to the original page to execute the remaining business logic? Is it true that WeChat authorization cannot be achieved through ajax?

WeChat authorization must be redirected through the WeChat URL. As for returning to the original business, you only need to pass your original URL and related status in the form of redirect_uri parameters before jumping
It is recommended to study the official documentation https://mp.weixin.qq.com/wiki...

Statement:
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