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

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

SublimeText3 Linux new version
SublimeText3 Linux latest version

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

Dreamweaver Mac version
Visual web development tools
