token驗證失敗
<?php
// 本類由系統自動生成,僅供測試用途
class IndexAction extends Action {
??? public function index(){
?? ??? ?$nonce = $_GET['nonce'];
?? ??? ?$token???? = 'weixin';
?? ??? ?$timestamp = $_GET['timestamp'];
?? ??? ?$echostr?? = $_GET['echostr'];
?? ??? ?$signature = $_GET['signature'];
?? ??? ?//形成數組,然后按字典序排序
?? ??? ?$array = array();
?? ??? ?$array = array($nonce, $timestamp, $token);
?? ??? ?sort($array);
?? ??? ?//拼接成字符串,sha1加密 ,然后與signature進行校驗
?? ??? ?$str = sha1( implode( $array ) );
?? ??? ?if( $str? == $signature ){
?? ??? ??? ?//第一次接入weixin api接口的時候
?? ??? ??? ?echo? $echostr;
?? ??? ??? ?exit;
?? ??? ?}
?? ??? ?
??? }
?? ?
?? ?public function show()
?? ?{
?? ??? ?echo 'hi' ;
?? ?}
沒套框架的時候驗證通過了, 套上框架就GG了,然后測試show()的時候也能顯示成功。。
2015-12-08
求助啊,驗證失敗
2015-11-14
?我的也是?,F在還是沒搞出來,求解
2015-11-11
額 , 解決了,,