|

100精币
已经https://g.alicdn.com/assets-group/isv-app-bridge-assets/0.0.47/entries/Bb6Rs8Q0.js
计算方式在里面
这secret_key应该是这里获取,
https://gw.open.1688.com/mapi/1/security/getSessionKey/2839818?access_token=ded411fa-74bd-4061-a5d8-7363571d61ab&_aop_timestamp=1746172818146【这里要用最新时间戳】
这一段
https://gw.open.1688.com/system/1/proxy/http/2839818?access_token=ded411fa-74bd-4061-a5d8-7363571d61ab&_aop_timestamp=1746172820696&_aop_target=https%3A%2F%2Fphjproxy.hornedshark.com%2Fonlineproxy%2Fptleai%2FerpAuthShop%2Flist%3F
怎么计算出
x-sign-hmac=qboO6HrXi08Jsf54q+8JlHHBjxM=
根据AI
import hashlib
import hmac
import base64
# 定义你的参数
app_key = '2839818' # 你的 app key
secret_key = 'F67062194F1FD1073385C1265BA4B51014F3B8E9' # 你的 secret key
access_token = 'ded411fa-74bd-4061-a5d8-7363571d61ab' # 你的 access token
url = 'https://phjproxy.hornedshark.com/onlineproxy/ptleai/erpAuthShop/list?' # 请求的目标 URL
post_data = '{"current":1,"pageSize":9999,"currentPage":1}' # 请求的 POST 数据
# 拼接签名字符串
timestamp = '1746172820696' # 你提供的时间戳
signature_string = f'/system/1/proxy/http/{app_key}?access_token={access_token}&_aop_timestamp={timestamp}&_aop_target={url}'
# 计算签名
signature = hmac.new(secret_key.encode(), signature_string.encode(), hashlib.sha1).hexdigest()
# 打印原始签名
print(f'Raw Signature: {signature}')
# 将签名进行 Base64 编码
base64_signature = base64.b64encode(bytes.fromhex(signature)).decode('utf-8')
# 打印 Base64 编码后的签名
print(f'Base64 Encoded Signature: {base64_signature}')
测试也是不对的,请js大佬教一下,感谢。
|
|