当前位置:网站首页>微信公众号服务器配置
微信公众号服务器配置
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 "认证失败";
} 

边栏推荐
- 论文笔记:LBCF: A Large-Scale Budget-Constrained Causal Forest Algorithm
- 从业一年,我是如何涨薪13K+?
- 知道这些面试技巧,让你的测试求职少走弯路
- Paper notes: lbcf: a large scale budget constrained causal forest algorithm
- Precautions for function default parameters (formal parameter angle)
- 炮打司令部,别让一个UI框架把你毁了
- [problem solving] dialogfragment can not be attached to a container view
- Day21 multithreading
- 使用hbuilder X创建uniapp项目
- Perfect shuffle problem
猜你喜欢

Read mysql45 the next day

Bugly hot update usage

Resolve the format conflict between formatted document and eslint

Day_ twelve

Dino: Detr with improved detecting anchor boxes for end to end object detection

【蓝桥杯集训100题】scratch指令移动 蓝桥杯scratch比赛专项预测编程题 集训模拟练习题第14题

Day_ ten

深入理解和把握数字经济的基本特征

20省市公布元宇宙路线图

Android修行手册之Kotlin - 自定义View的几种写法
随机推荐
心樓:華為運動健康的七年築造之旅
Read mysql45 lecture - index
Record learning of hystrix knowledge --20210929
什么是骨干网
_ 17 collection overview
Bugly hot update usage
GO语言-什么是临界资源安全问题?
Data type variable operator
Go language - lock operation
Day_ 18 hash table, generic
Navicat premium 15 for MAC (database development tool) Chinese version
Swift responsive programming
数字经济时代文化消费新特征
【機器學習】基於多元時間序列對高考預測分析案例
Paper notes: generalized random forests
Day_ fourteen
[untitled]
ES6 deconstruction assignment rename
ncnn源码学习全集
10 Super VIM plug-ins, I can't put them down