Token校验失败,请检查确认
其实一般报这个错误的原因大多就是验证的函数写错了
官网给的示例
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
private function checkSignature(){ $signature = $_GET["signature"]; $timestamp = $_GET["timestamp"]; $nonce = $_GET["nonce"]; $token = 'liqingbo'; $tmpArr = array($token, $timestamp, $nonce); sort($tmpArr, SORT_STRING); $tmpStr = implode( $tmpArr ); $tmpStr = sha1( $tmpStr ); if ($tmpStr == $signature ) { return true; } else { return false; }} |
其实还需要些一个函数
|
1
2
3
4
5
6
7
8
9
10
|
public function valid(){ $echoStr = $_GET["echostr"]; //valid signature , option if($this->checkSignature()){ echo $echoStr; exit; }} |
地址URL(服务器地址)
我以为的:域名/函数地址(checkSignature)
其实是:域名/函数地址(valid)
OK了


还没有内容
评论已关闭!