当前位置:网站首页>Wechat applet opening customer service message function development

Wechat applet opening customer service message function development

2022-06-25 08:12:00 On procedural retreat

1. Log in to the background of wechat applet

2. Find the development... Under the left column - Set up - Message push

Make the following configuration , Before clicking submit , You need to write the code on the server first

3. Server code

function checkSignature()
    {
        $signature = $_GET["signature"];
        $timestamp = $_GET["timestamp"];
        $nonce = $_GET["nonce"];
        $echostr = $_GET["echostr"];
        $token = "g******o";
        $tmpArr = array($token, $timestamp, $nonce);
        sort($tmpArr, SORT_STRING);
        $tmpStr = implode( $tmpArr );
        $tmpStr = sha1( $tmpStr );
        if( $tmpStr == $signature ){
            echo  $echostr;
        }else{
            echo  false;
        }

4. Click on the submit , Configuration is successful , If you are prompted token Incorrect , Look at the server background token And applet background token Is it consistent , Whether the server URL can be opened , Configured url Whether the address is consistent with the address on the server

5. After successful configuration , Start developing code

 

原网站

版权声明
本文为[On procedural retreat]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/176/202206250547108510.html