In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
What this article shares with you is about how WeChat Mini Programs manages and deploys in batches. The editor thinks it is very practical, so I share it with you. I hope you can get something after reading this article. Without saying much, let's take a look at it with the editor.
Our company has a lot of Mini Program, which is very inconvenient to manage, which is mainly reflected in Mini Program audit. Every time we develop a version and upload the code of mini programs, we have to log in to the background of each Mini Program to submit it for review. So we urgently need a Mini Program management background, which can manage Mini Program in batches. After consulting the relevant documents, we found that the third-party platform function of Wechat can meet our needs.
However, the Wechat third-party platform does not provide graphical interface operation, just provides some interfaces, so we developed a platform ourselves, most of the interfaces are mainly the interfaces of the Wechat third-party platform, and the graphical page is developed according to our own needs. The main core function we use is the code management related interface function of the third-party platform.
Log in to the Wechat open platform to register a third-party platform account, and a third-party platform can manage multiple Mini Program. After Mini Program is authorized to a third-party platform, the daily development operation is the same as before without authorization, except that, after authorization, the Mini Program code is uploaded to the third-party platform code draft box rather than the Mini Program backend.
Developers can add the code in the draft box to the Mini Program template library, and the templates in the Mini Program template library will not be overwritten. You can have up to 50 code templates, and you can get a template ID (TemplateID) after you add it. Call the relevant code management interface to deploy the code for multiple Mini Program.
Talk about the steps for third-party platform authorization.
Wechat tripartite platform is also an account on the Wechat open platform, and also has the concept of appid. In Wechat's documents, the three-party platform is called "component". The three-party platform needs to implement a URL for Wechat callback, which is called "authorization event receiving URL" in the platform (hereinafter referred to as "notification callback"), and is configured in the application details page.
Wechat sends a message to the notification callback every 10 minutes, notifying the backend of the three platforms of the parameter component_verify_ticket. After the three-party platform gets this message, it needs to use its own app_secret and appid information, plus the ticket pushed by Wechat, to exchange component_access_token from the Wechat platform through the api_component_token interface of the Wechat three-party platform.
First, the backend of the three-party platform requests Wechat to obtain the pre-authorization code pre_auth_code;. The second step is to use this pre-authorization code to combine it into a URL to scan the Mini Program owner's code.
The key parameters are as follows (componentloginpage is the URL used for code scanning):
Obtain authorized Mini Program
After the Mini Program administrator scans the code for authorization, Wechat will send a message to the notification callback. In addition to notifying the authorized WeChat Mini Programs (called "authorizer") of the appid, the most important thing is to push a new ticket field authorization_code, which is bound to WeChat Mini Programs who granted the permission:
Obtain Mini Program information and its granted permissions
These are the two API, the more important of which is to pull the permission scope granted by Mini Program and call the API "api_query_auth". In addition to the scope of authorization, the most important thing is to introduce two new parameters:
Authorizer_access_token: the access_token parameter of WeChat Mini Programs.
Authorizer_refresh_token: used to refresh access_token regularly
The relevant APIs for managing Mini Program need API access_token Mini Program to call tokens and obtain methods.
Verification bill
Get token token (component_access_token) is the call credential of the third-party platform interface
Pre-authorized code
Use authorization codes to obtain authorization information
Get / refresh API call token
This is how WeChat Mini Programs manages the deployment in batches. The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.