首页 > 代码库 > wechat开发

wechat开发

 

 

 

 

 

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

 

 

技术分享

 

wechat开发