当前位置:网站首页>微信公众号服务器配置
微信公众号服务器配置
2022-06-25 16:12:00 【呀哈】
使用微信官方提供的方法一直报错
{errcode: -106, errmsg: "token check fail"}
errcode: -106
errmsg: "token check fail"然后在网上找到了一个方法成功解决
define("TOKEN", "就是下方图片中标红框自己设置的token值");
$echostr = $_GET["echostr"];
function checkSignature()
{
$signature = $_GET["signature"];
$timestamp = $_GET["timestamp"];
$nonce = $_GET["nonce"];
$token = TOKEN;
$tmpArr = array($token, $timestamp, $nonce);
sort($tmpArr, SORT_STRING);
$tmpStr = implode( $tmpArr );
$tmpStr = sha1( $tmpStr );
if( $tmpStr == $signature ){
return true;
}else{
return false;
}
}
if(checkSignature()){
echo $echostr;
}else{
echo "认证失败";
} 

边栏推荐
猜你喜欢
随机推荐
Read AFN through - from the creation of manager to the completion of data parsing
Understanding of reflection part
GO语言-什么是临界资源安全问题?
【蓝桥杯集训100题】scratch指令移动 蓝桥杯scratch比赛专项预测编程题 集训模拟练习题第14题
Precautions for function default parameters (formal parameter angle)
Bypass technology to talk about 'cross end'
What is backbone network
flutter
Perfect shuffle problem
User login 2
Multiple decorators decorate a function
Principle analysis of ThreadLocal source code
error Parsing error: Unexpected reserved word ‘await‘.
什么是骨干网
软件测试面试如何正确谈薪
Servlet details
Bombard the headquarters. Don't let a UI framework destroy you
First knowledge of database
解析数仓lazyagg查询重写优化
论文笔记:LBCF: A Large-Scale Budget-Constrained Causal Forest Algorithm









