Home > WeChat Applet > Mini Program Development > Can I log in to the mini program webpage?

Can I log in to the mini program webpage?

Release: 2020-03-27 10:00:36
Original
3836 people have browsed it

Can I log in to the mini program webpage?

The mini program can be logged in on the web page.

Mini program implements web page login

1.PC obtains the QR code for login:

https://live.haicaoyun.com/hms/hcyWeddingWall/appApi/webLogin/getQrCode?current_time=1571723998231
Copy after login

The server returns two data 1. Picture of the QR code. 2. The client’s identification key.

This QR code is generated by the server calling the mini program interface after the client sends a request. We know that the QR code generated by the WeChat applet jumps to the specified page and carries parameters.

Therefore, the user is guided in the mini program to scan the QR code on the PC side. The following picture shows the page in the mini program:

Can I log in to the mini program webpage?

After the user scans, it is quite For WeChat to allow users to jump to a page in the mini program, we can forge an authorization login page (this page is made by our front end, not WeChat's own). As shown below, the user is redirected to our fake login page by WeChat:

Can I log in to the mini program webpage?

After the user clicks to log in, the key (this key is passed by WeChat after scanning the QR code ) is passed to the server, meaning the client is ready.

At the same time, the PC side continuously trains the server login interface with key. After the server receives the information prepared by the client, it returns the successful login information to the PC side. The following picture shows the polling on the PC side:

Can I log in to the mini program webpage?

Because we actually use the jump function of the WeChat applet QR code to do pseudo web page login.

PC-side polling will put a certain amount of pressure on the server, so the time/number of polls can be designed to allow users to refresh the QR code after expiration.

Recommendation: " Mini Program Development Tutorial"

The above is the detailed content of Can I log in to the mini program webpage?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
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