小程序
小游戏
企业微信
微信支付
扫描小程序码分享
最后的代码字典不知道写哪里对
2 个回答
加粗
标红
插入代码
插入链接
插入图片
上传视频
你好,404表示请求的资源在服务器上不存在或未找到:https://zhuanlan.zhihu.com/p/647024023。请自查服务器问题
你好,麻烦通过点击下方“反馈信息”按钮,提供出现问题的。
本回答由AI生成,可能已过期、失效或不适用于当前情形,请谨慎参考
关注后,可在微信内接收相应的重要提醒。
请使用微信扫描二维码关注 “微信开放社区” 公众号
你好,404表示请求的资源在服务器上不存在或未找到:https://zhuanlan.zhihu.com/p/647024023。请自查服务器问题
这几个代码代表含义帮我解说下可以?
https://abc.yywyc.cn/80
token
连接到你的服务器发生错误。
调试信息:
HTTP状态码:404
CURL错误码:-1
CURL状态原因:
CURL状态解释:
推送的URL链接:https://abc.yywyc.cn/80?signature=43ef7bccce4eb7ef4500aac59f3affc95dea5818&echostr=172118437002472270×tamp=1758694214&nonce=812541810
URL参数中的signature签名过程:
1. 将token、timestamp(URL参数中的)、nonce(URL参数中的)三个参数进行字典序排序,排序后结果为:["1758694214","812541810","token"]
2. 将三个参数字符串拼接成一个字符串:"1758694214812541810token"
3. 进行sha1签名计算:43ef7bccce4eb7ef4500aac59f3affc95dea5818
4. 开发者需按照此流程计算签名并与URL参数中的signature进行对比验证,相等则验证通过
echostr = "172118437002472270"
你返回的echostr = ""
# filename: handle.py
import hashlib
import web
class Handle(object):
def GET(self):
try:
data = web.input()
if len(data) == 0:
return "hello, this is handle view"
# 从请求参数中获取值
signature = 43ef7bccce4eb7ef4500aac59f3affc95dea5818
timestamp = 1758694214
nonce = 812541810
echostr = 172118437002472270
token = "token" # 请按照公众平台官网基本配置中信息填写
# 验证签名
list = [token, timestamp, nonce]
list.sort() # 字典序排序
sha1 = hashlib.sha1()
sha1.update("".join(list).encode('utf-8')) # 拼接字符串并加密
hashcode = sha1.hexdigest()
print("handle/GET func: hashcode, signature: ", hashcode, signature)
if hashcode == signature:
return echostr
else:
return ""
except Exception as Argument:
return str(Argument)