NO.1 WeChat third-party platform creation

Official document

It is best to be familiar with the above documents first

text:

Step 1️⃣: Homepage=》Management Center=》Third-party platform=》Create a third-party platform

Step 2️⃣: Enter the basic information = "Enter the information filling page = "The platform type depends on what you need, and the specific difference documents have detailed instructions

Step 3️⃣: Choose permissions, tick them according to your needs, tick them all if you don't understand them. . . That’s how I did the first operation

Step 4️⃣: Fill in the development information. Note that the stuff on this page is very important, and has a very important relationship with the interface docking later. If there is no domain name, you can do an intranet penetration. I use Natapp . You can refer to this one-minute tutorial for beginners to solve the domain name problem perfectly. It is recommended not to use free, free temporary domain names are easy to switch;

Step 4: Explanation of the terms filled in the development materials:

Authorization initiation page domain name: You must jump to the login authorization page from the web page within this domain name to complete the login authorization. No need to fill in the domain name protocol prefix such as http://. For local development, just write the domain name penetrated by your intranet.
List of authorized test official accounts: Before the entire network is released, only official accounts in this list can be authorized for testing. Please fill in the original ID of the official account (which can be found on the official account setting page of the official platform website), up to 10, separated by English ";".
Authorization event receiving URL: used to receive cancellation of authorization notification, authorization success notification, authorization update notification, and also used to receive tickets. Tickets are important credentials to verify the platform; Note: After the third-party platform is created and approved, the WeChat server will send Its "authorized event receiving URL" regularly pushes component_verify_ticket every 10 minutes. The third-party platform also needs to decrypt after receiving the ticket push (for details, please refer to the [Message Encryption and Decryption Access Guidelines]), and it must directly return the string success after receiving it. code show as below:

Need to download WeChat decryption tools

 /**
     * 接收ticket
     */
    @RequestMapping("ticket")
    public String ticket(HttpServletRequest request) throws Exception {
        log.info("接收ticket==================》开始");
        String msgSignature = request.getParameter("msg_signature");
        String timeStamp = request.getParameter("timestamp");
        String nonce = request.getParameter("nonce");

        log.info("开始接受postdata---" + request.getInputStream());
        BufferedReader br = new BufferedReader(new InputStreamReader(request.getInputStream()));
        StringBuffer sb = new StringBuffer();
        String line = null;
        while ((line = br.readLine()) != null) {
            sb = sb.append(line);
        }
        String postData = sb.toString();
        log.info(msgSignature + "==============》" + timeStamp + "==============》" + nonce + "==============》" + postData);
        WXBizMsgCrypt pc = new WXBizMsgCrypt(WeiXinConstant.TOKEN, WeiXinConstant.ENCODING_AESKEY, WeiXinConstant.APP_ID);
        String result = pc.decryptMsg(msgSignature, timeStamp, nonce, postData);
        //appId 第三方平台APPid;
        // InfoType component_verify_ticket;
        // ComponentVerifyTicket Ticket内容
        log.info(result + ".................");
        return "success";
    }
Message verification Token: When the developer receives a message instead of the official account or mini program, the Token is used to verify the message. One of the parameters used for the above interface decryption, set by yourself
Message encryption/decryption key: used in the process of sending and receiving messages instead of official accounts or small programs. It must be a 43-character string, only letters and numbers. One of the parameters used for the above interface decryption, set according to the requirements
Message and event receiving URL: This link is being explored. . .
Mini Program Server Domain Name: The domain name that still penetrates the intranet
Mini Program Business Domain: This is to download a text, follow the instructions he gave you to download, and put it into the local project before the download is complete. Then use the proxy domain name to visit, for example, my proxy domain name is www.zjj___.com; the downloaded text name is zjj.text; just put www.zjj___.com/zjj.text in the browser to visit, visit If it arrives, just fill in the domain name www.zjj__.com in the text box. Since my local project is springboot, I can directly access this text by directly dropping this text into the static file under resources. Otherwise, I don't know if it should be placed in the tomcat directory. You can try it.
Whitelisted IP address list: Only when the developer's IP address is in this list, can they be allowed to call related interfaces. Fill in up to 100 IP addresses, separated by English ";".

My QQ: 571726193

Group (few newcomers): 1030289715

Welcome to communicate and point out any questions.

Guess you like

Origin blog.csdn.net/zhaojunjie_cc/article/details/96476339