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

边栏推荐
- About the use of Aidl, complex data transmission
- Wireshark网卡无法找到或没有显示的问题
- Alvaria宣布客户体验行业资深人士Jeff Cotten担任新首席执行官
- Once the code was encrypted by the company's computer, the compilation failed
- Apijson simple to use
- 3年,我是如何涨薪到20k?
- Day_ 16 set
- 論文筆記:LBCF: A Large-Scale Budget-Constrained Causal Forest Algorithm
- Day_ 04
- 3. conditional probability and independence
猜你喜欢

使用hbuilder X创建uniapp项目

Precautions for function default parameters (formal parameter angle)

Day_ seventeen

Read mysql45 the next day

mac php多版本管理以及安装swoole扩展

Detailed explanation of IVX low code platform series -- Overview (I)

Navicat Premium 15 for Mac(数据库开发工具)中文版

App测试工具大全,收藏这篇就够了

Optimization of lazyagg query rewriting in parsing data warehouse

DOM event flow, event delegate
随机推荐
_ 19_ IO stream summary
10 Super VIM plug-ins, I can't put them down
Reverse series to obtain any wechat applet code
Day_ twelve
Dino: Detr with improved detecting anchor boxes for end to end object detection
Prototype chain analysis
DINO: DETR with Improved DeNoising Anchor Boxes for End-to-End Object Detection翻译
Day_ 16 set
1-8file sharing in VMWare
Nsurlsession learning notes (III) download task
Unity技术手册 - 生命周期内大小(Size over Lifetime)和速度决定大小(Size by Speed)
How to view the change trend of cloud database from the behind of the launch of tidb to Alibaba cloud
Principle analysis of ThreadLocal source code
绕过技术聊'跨端'......
Multiple decorators decorate a function
【精通高并发】深入理解C语言基础与汇编下的C语言
mac php多版本管理以及安装swoole扩展
One minute to familiarize yourself with the meaning of all fluent question marks
The first day of reading mysql45
Bombard the headquarters. Don't let a UI framework destroy you