perf: Assistant dynamic ds api param

This commit is contained in:
fit2cloud-chenyw
2025-07-29 09:34:52 +08:00
parent df4dc1672a
commit 7cd4d783cd
+4 -2
View File
@@ -101,13 +101,15 @@ class AssistantOutDs:
certificateList: list[any] = json.loads(self.certificate)
header = {}
cookies = {}
param = {}
for item in certificateList:
if item['target'] == 'header':
header[item['key']] = item['value']
if item['target'] == 'cookie':
cookies[item['key']] = item['value']
res = requests.get(url=endpoint, headers=header, cookies=cookies, timeout=10)
if item['target'] == 'param':
param[item['key']] = item['value']
res = requests.get(url=endpoint, params=param, headers=header, cookies=cookies, timeout=10)
if res.status_code == 200:
result_json: dict[any] = json.loads(res.text)
if result_json.get('code') == 0: