当前位置:网站首页>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 )
边栏推荐
- Wechat card issuing applet source code - automatic card issuing applet source code - with flow main function
- QML module not found
- Some summary about function
- Mouseevent event -- mouse coordinate description -- Focus event -- input event -- throttle -- mousewheel (wheel event)
- Don't vote, software testing posts are saturated
- MapGIS格式转ArcGIS方法
- Preliminary study on Tesseract OCR
- Why is the integer type 128 to byte -128
- JS timer and swiper plug-in
- Title: give a group of arrays, arranged from large to small and from small to large.
猜你喜欢

聚名十年,说出你的故事,百万豪礼等你拿

【汇编语言01】基础知识

3. Editors (vim)

Title: give a group of arrays, arranged from large to small and from small to large.

xxl-job中 关于所有日志系统的源码的解读(一行一行源码解读)

Imitation Tiktok homepage interface

数据库进阶·如何针对所有用户数据中没有的数据去加入随机的数据-蜻蜓Q系统用户没有头像如何加入头像数据-优雅草科技kir

Playwright tutorial (I) suitable for Xiaobai

『SignalR』.NET使用 SignalR 进行实时通信初体验

面了个腾讯三年经验的测试员,让我见识到了真正的测试天花板
随机推荐
Based on if nesting and function call
Square root of X
win10搭建flutter环境踩坑日记
3day
TS:typora代码片段缩进显示异常(已解决)-2022.7.24
Minor GC 和 Full GC 有什么不同呢?
Playwright tutorial (I) suitable for Xiaobai
SQL basic statement DQL select and extract DML insert delete
[test development methodology] experience of test development platform PK - choice
在腾讯干软件测试3年,7月无情被辞,想给划水的兄弟提个醒...
开户就可以购买收益在百分之六以上的理财产品了吗
What should I do if I encounter the problem of verification code during automatic testing?
6-17漏洞利用-反序列化远程命令执行漏洞
[fan Tan] after the arrival of Web3.0, where should testers go? (ten predictions and suggestions)
SMART S7-200 PLC通道自由映射功能块(DO_Map)
internship:普通常用的工具类编写
6-17 vulnerability exploitation - deserialization remote command execution vulnerability
c sqlite ... ...
JMeter websocket接口测试
[51nod1676 undirected graph isomorphism] undirected graph hash [easy to understand]