In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article will explain in detail how to build a local test environment for the development of java Wechat official account. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.
Test official account
Wechat official account has Subscription account, service number, enterprise account, when you see such information when registering, only Subscription account can apply personally, and the service number and enterprise account must have enterprise qualification. The development of Wechat official account here refers to Subscription account and the service number.
In addition, the unauthenticated individual Subscription account has some interfaces that do not have permissions, and at present, personal Subscription account no longer supports Wechat authentication, that is to say, personal Subscription account cannot call some advanced permission interfaces. The following picture is a list of permissions that an unauthenticated individual Subscription account has, such as generating QR code, web page authorization, custom menu, WeChat Pay and other interface permissions are not available.
Said for a long time, then if there is no enterprise qualification, but also want to do advanced interface development how to do.
Wechat public platform provides a test public account, login address is: http://mp.weixin.qq.com/debug/cgi-bin/sandbox?t=sandbox/login, just go to this page, click to log in, and scan the code with your own Wechat client, and authorize login, you can get your own test official account. The test official account has almost all the interfaces. If the developer does not have an official account available, you can use the official account of this test.
Local test environment
One of the major pains of developing Wechat public accounts is debugging. Each time you implement a function, you need to deploy to a public network server. Although there are various free cloud platforms that can be deployed, the mode basically can only rely on log output. And there are no modifications-> deployment-> view logs. This operation is a waste of time, and time is life. Isn't this a waste of life? So, is there any way to deploy and debug locally?
Of course, because every time an instruction is sent to the official account, the server where the official account is located will interact with your server on the network, so your server should ensure that the public network can be accessed. Then you only need to map you locally to a public network address to realize the local debugging of the Wechat official account. There are a lot of software that provides this function, such as peanut shells, but there is a charge. Here is a free software, ngrok, access may require FQ. According to the local version, windows or linux, and then register the account, after the account registration, you will get a free authorization code, which will be used when starting ngrok for the first time.
Take my local as an example, I downloaded the windows version. After downloading and decompressing it, find the decompression directory, double-click ngrok.exe, and enter the following command when starting for the first time:
Ngrok-authtoken Authorization Code 80
After that, double-click ngrok.exe. After startup, enter the command to map the local machine to the public network, and map the web service under the local port 8080 to the public network port 80. The command is as follows:
Ngrok http 8080
The interface after startup is as follows:
The red part is the mapped public network address, and now to access this address is to access the local port 8080. But in the free version of ngrok, the generated public network mapping address is random, and each restart will be different, but it doesn't matter, because the ngrok will not be shut down once a day. After each startup, go to the Wechat test official account management page and reconfigure it.
So far, ngrok is available, that is to say, although the ngrok server is blocked, the Wechat official account server is accessible, so it doesn't prevent us from doing local modulation. You just need to FQ to download the registration ngrok.
There are also some ngrok servers in China, but they have not been tried. If you are interested, you can search them on your own. Of course, if you have the ability, you can build your own ngrok platform, ngrok is implemented in go language.
This is the end of the article on "how to build a local test environment for the development of the official account of java Wechat". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.
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.