wechat開發

nd發表於2016-09-26

 

 1.easywechat安裝

 

 

 2.weichat打通伺服器

    function  getTest(Request $request){
        $token = 'zhenhaokeji';
        $data = $request->all();
        $signature = $data['signature'];
        $timestamp = $data['timestamp'];
        $nonce = $data['nonce'];
        $echostr = $data['echostr'];
        $arrtep = array($token, $timestamp, $nonce);
        sort($arrtep, SORT_STRING);
        $arrStr = implode($arrtep);
        $hashcode = sha1($arrStr);
        if($hashcode == $signature){
            return $echostr;
        }else{
            return false;
        }

    }

 

相關文章