{"id":100422,"date":"2018-06-22T11:11:57","date_gmt":"2018-06-22T03:11:57","guid":{"rendered":"http:\/\/www.ilezhi.cn\/?p=100422"},"modified":"2018-06-22T11:17:19","modified_gmt":"2018-06-22T03:17:19","slug":"%e5%be%ae%e4%bf%a1%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0","status":"publish","type":"post","link":"http:\/\/www.ilezhi.cn\/?p=100422","title":{"rendered":"\u5fae\u4fe1\u5f00\u53d1\u7b14\u8bb0"},"content":{"rendered":"<p>1\u3001token\u9a8c\u8bc1\u3002\u670d\u52a1\u5668\u5730\u5740\uff1ahttp:\/\/***\/public\/index.php\/index\/Wechat\/index<br \/>\n\u6587\u4ef6\u8def\u5f84\uff1a\\application\\index\\controller\\Wechat.php<\/p>\n<pre class=\"lang:php decode:true\" data-url=\"\\application\\index\\controller\\Wechat.php\">&lt;?php\r\nnamespace app\\index\\controller;\r\n\r\nuse think\\facade\\Config;\r\nuse think\\facade\\Request;\r\n\r\nclass Wechat{\r\n    public function index(){\r\n        $token     = Config::get('wechat.official_account.default.token');    \r\n        $echostr   = 'failure';  \r\n        $timestamp =Request::get('timestamp');          \/\/input('timestamp');\/\/\r\n        $nonce     =Request::get('nonce');              \/\/input('nonce');\/\/ \r\n        $signature = Request::get('signature');         \/\/input('signature');\/\/\r\n       \r\n        $list     = array($token, $timestamp, $nonce);\r\n        $hashcode = sort($list, SORT_STRING) ? sha1(implode('', $list)) : '';\r\n        if($hashcode == $signature) {\r\n            $echostr =input('echostr');\r\n        }\r\n        return $echostr;    \/\/ \u9a8c\u8bc1\u65f6\u5fc5\u987b\u5173\u95ed\u8c03\u8bd5\u6a21\u5f0f\r\n    }\r\n}<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1\u3001token\u9a8c\u8bc1\u3002\u670d\u52a1\u5668\u5730\u5740\uff1ahttp:\/\/***\/public\/index.php\/index\/Wecha &hellip; <a href=\"http:\/\/www.ilezhi.cn\/?p=100422\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb<span class=\"screen-reader-text\">\u5fae\u4fe1\u5f00\u53d1\u7b14\u8bb0<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-100422","post","type-post","status-publish","format-standard","hentry","category-share"],"_links":{"self":[{"href":"http:\/\/www.ilezhi.cn\/index.php?rest_route=\/wp\/v2\/posts\/100422","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.ilezhi.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.ilezhi.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.ilezhi.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.ilezhi.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=100422"}],"version-history":[{"count":0,"href":"http:\/\/www.ilezhi.cn\/index.php?rest_route=\/wp\/v2\/posts\/100422\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.ilezhi.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=100422"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.ilezhi.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=100422"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.ilezhi.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=100422"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}