wechat开发

 

 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;
        }

    }

 

posted @ 2016-09-26 19:19  nd  阅读(567)  评论(0编辑  收藏  举报