mirror of
https://git.oceanpay.cc/danial/kami_itunes_third_api.git
synced 2025-12-18 22:20:08 +00:00
fix(master_node): 修复请求数据格式及添加接口返回日志
- 将请求参数由 form-data 格式改为 JSON 格式,确保接口正确接收数据 - 添加日志记录接口返回的响应内容及提交的数据,方便调试和问题排查 - 优化了加密数据的构建方式,使代码结构更清晰
This commit is contained in:
@@ -43,19 +43,20 @@ class MasterNodeService:
|
||||
with self.single_lock:
|
||||
try:
|
||||
self.single_lock.acquire()
|
||||
data = {
|
||||
"machineId": encrypt_with_aes(
|
||||
f"{machineId}:{int(time.time())}",
|
||||
AESKey.load_from_base64(
|
||||
"P0x6Gy6dXIpPbhE7PHxaHbfZHhsbT2qNPlx3qbHTP1o="
|
||||
),
|
||||
AESKey.load_from_base64("nywao1XkDXeYwbPeWh+SxA=="),
|
||||
),
|
||||
}
|
||||
response = self.__client.post(
|
||||
urljoin(
|
||||
self.__address, "/api/cardInfo/appleCard/rechargeOrder/handler"
|
||||
),
|
||||
data={
|
||||
"machineId": encrypt_with_aes(
|
||||
f"{machineId}:{int(time.time())}",
|
||||
AESKey.load_from_base64(
|
||||
"P0x6Gy6dXIpPbhE7PHxaHbfZHhsbT2qNPlx3qbHTP1o="
|
||||
),
|
||||
AESKey.load_from_base64("nywao1XkDXeYwbPeWh+SxA=="),
|
||||
),
|
||||
},
|
||||
json=data,
|
||||
proxies={
|
||||
"http": "",
|
||||
"https": "",
|
||||
@@ -65,6 +66,7 @@ class MasterNodeService:
|
||||
},
|
||||
timeout=30,
|
||||
)
|
||||
logger.info(f"接口返回数据:{response.text} 提交数据:{data}")
|
||||
response_json = response.json()
|
||||
except Exception as e:
|
||||
logger.error(f"请求数据异常,{e},")
|
||||
|
||||
Reference in New Issue
Block a user