Home > WeChat Applet > Mini Program Development > Things to note when developing WeChat applet login and decryption modules

Things to note when developing WeChat applet login and decryption modules

little bottle
Release: 2019-04-26 15:23:04
forward
3707 people have browsed it

If the login decryption problem is not handled well during the development of WeChat Xiaocheng, an error will be reported when logging in. This article is a summary of the things developers should pay attention to when developing the login decryption module for WeChat public accounts. I am going to do this. Friends who are involved in development can learn more about it.

In the development of WeChat Mini Program, the login problem must be in this order

  1. The mini program requests login, gets the code and then passes it to the service end;

  2. The server gets the code and goes to the WeChat server to get the sessionKey;

  3. Then the applet calls the getuserinfo interface to get the encryptedData, iv, Then give it to the server;

  4. The server gets the client's encryptedData, vi and the previous sessionKey to decrypt to get user information such as unionId; otherwise, such problems will occur. This situation The reason for this accidental occurrence is that getuserinfo is called before the server gets the sessionKey. Sometimes it is faster than the server, and sometimes it is slower than the server, so there is an accident.

Related tutorials: WeChat Mini Program Video Tutorial

The above is the detailed content of Things to note when developing WeChat applet login and decryption modules. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:cnblogs.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
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template