当前位置:网站首页>Wechat official account application development (I)
Wechat official account application development (I)
2022-07-25 22:14:00 【uesowys】
1. Preface
Wechat platform provides open platform related interfaces API, Enterprise users or developers can use open interfaces API Customize and develop business applications , And you can bind the link address of the development application to the wechat official account menu , Wechat end users can subscribe or share content by following official account 、 Use customized business applications through menu links provided by official account .
2. Development version
The development version of this chapter mainly uses the interface of wechat open platform API To develop a Third party business applications , The simple function provided by this application is to access wechat user login , After wechat users successfully log in to the third-party business application , Functions provided by third-party business applications can be used normally .
Third party refers to enterprise users or developers , It belongs to the business application provider , The customized applications need to be connected to the menu of personal official account or enterprise official account .
In the field of Internet software , The architecture model of wechat open platform is called PAAS, The architecture model of third-party business applications is called SAAS. Wechat users are End user , Use SAAS Application business functions provided .
2.1. Application requirements
2.1.1. The login process
- WeChat users A Official account B
- WeChat users A Click the public number B The menu in C
- Show wechat users A Login screen
- WeChat users A Click the login button
- WeChat users A Successfully authorized third-party applications
- Display the homepage of third-party business applications
2.1.2. The home page shows
Show wechat cloud hosting promotion homepage
2.2. development tool
- JDK18 Running environment
- Eclipse The latest version of development tools
- Spring Boot Development framework
- Apache Maven Dependency management
- Peanut shell server-side agent software
2.2.1. Build code engineering

2.2.2. Develop the interactive interface of official account

2.2.3. Run application engineering

2.2.4. Configure peanut shell agent
Bound peanut shell Dynamic proxy domain name To the port where the application runs locally , As shown below :

2.2.5. Test the interactive interface of official account
Peanut shell Dynamic domain name is bound Official account interactive interface to locally running application code , His address is :
https://55vl963292.goho.co/main/
2.3. Bind the official account to interact mouth
1. Login WeChat Official account management platform
2. Bind wechat official account interactive interface address :
https://55vl963292.goho.co/main/

2.4. Develop official account menu
Call wechat open platform interface in the interactive interface of official account API Create a menu .
2.4.1. obtain access_token
access_token The official account is the only global interface invoke credential. , Official account calls for interfaces. access_token. among ACCESS_TOKEN_URL It belongs to wechat open platform API Address 、APP_ID It is the developer of wechat official account ID、APP_SECRET It is the wechat official account developer key . The body code is as follows :

2.4.2. Open interface to create menu
Use the access_token, Request the menu creation of wechat open platform API. among ,CREATE_MEMU_URL It belongs to wechat open platform API Address . The body code is as follows :

2.4.3. Response event creation menu
Create menus in the interactive interface of wechat open platform , The code is as follows :

2.5. Develop the homepage of third-party applications
2.5.1. Wechat login page parameters
The wechat login address of using peanut shell agent to run the application locally is :
https://55vl963292.goho.co/, The description of page login parameters is as follows :

among redirect_uri Equal to the homepage address of the third-party application :
https://55vl963292.goho.co/pages/index
The user clicks “ Confirm login ” Button to successfully log in , Log in successfully and jump to the homepage of the third-party application in the next step .
2.5.3. Third party application homepage display
The homepage address of using peanut shell agent to run the application locally is :
https://55vl963292.goho.co/pages/index, The interface display effect is shown in the following figure :

2.6. Test third-party business applications
1. Follow official account on wechat
2. Click official account menu business
3. Commercial version
The commercial version mainly uses the cloud services provided by Tencent cloud , The application architecture mainly uses the traditional business application software system architecture mode : Top down layered architecture , They are the network load balancing layer 、 Front end separation layer 、 Back end separation layer 、 Data storage layer , Each layer uses the cloud services provided by Tencent cloud .
( To be continued )
边栏推荐
- mysql: error while loading shared libraries: libncurses.so.5: cannot open shared object file: No suc
- 成为比开发硬气的测试人,我都经历了什么?
- Redis基础2(笔记)
- All you want to know about interface testing is here
- ArcGIS中的WKID
- 『Skywalking』.NET Core快速接入分布式链路追踪平台
- How to call the size of two numbers with a function--- Xiao Tang
- Title: give a group of arrays, arranged from large to small and from small to large.
- C language: random generated number + bubble sort
- D3.js learning
猜你喜欢

ArcGIS10.2配置PostgreSQL9.2标准教程

SMART S7-200 PLC通道自由映射功能块(DO_Map)

Summary of function test points of wechat sending circle of friends on mobile terminal

还不懂mock测试?一篇文章带你熟悉mock

Victoriametrics single node of kubernetes

On the difference between break and continue statements

自动化测试岗花20K招人,到最后居然没一个合适的,招两个应届生都比他们强吧

Selenium basic use and use selenium to capture the recruitment information of a website (continuously updating)

The technical aspects of ByteDance are all over, but the result is still brushed. Ask HR why...

在进行自动化测试,遇到验证码的问题,怎么办?
随机推荐
SMART S7-200 PLC通道自由映射功能块(DO_Map)
The testing work is not valued. Have you changed your position?
On the difference between break and continue statements
QML module not found
在进行自动化测试,遇到验证码的问题,怎么办?
Three ways to allocate disk space
淦,为什么 '𠮷𠮷𠮷' .length !== 3 ??
The automation testing post spent 20K recruiting, but in the end, there was no suitable one. Both fresh students are better than them
C语言:随机生成数+冒泡排序
vim用法记录
完啦,上班三个月,变秃了
H5 lucky scratch lottery free official account + direct operation
[fan Tan] those stories that seem to be thinking of the company but are actually very selfish (I: building wheels)
SQL中in的用法 DQL 查询
Based on if nesting and function call
How many bytes does Boolean occupy?
Visitor mode
[Fantan] how to design a test platform?
6-17 vulnerability exploitation - deserialization remote command execution vulnerability
Collation of SQL statement exercises