调试一下jd,超时问题。
This commit is contained in:
@@ -195,7 +195,11 @@ class DashboardServer:
|
||||
# 获取当前登录的微信ID
|
||||
|
||||
# 从新的resp格式中获取用户信息
|
||||
user_data = {}
|
||||
user_data = {
|
||||
"wxid": self.robot.wxid,
|
||||
"nickName": self.robot.nickname,
|
||||
"mobile": self.robot.phone
|
||||
}
|
||||
if not user_data:
|
||||
return {"success": False, "message": "未获取到用户数据"}
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ class QL:
|
||||
url = f"{self.address}/open/auth/token?client_id={self.id}&client_secret={self.secret}"
|
||||
try:
|
||||
# 添加超时参数
|
||||
rjson = requests.get(url, timeout=10).json()
|
||||
rjson = requests.get(url, timeout=(5, 15)).json()
|
||||
if (rjson['code'] == 200):
|
||||
self.auth = f"{rjson['data']['token_type']} {rjson['data']['token']}"
|
||||
else:
|
||||
@@ -54,7 +54,7 @@ class QL:
|
||||
headers = {"Authorization": self.auth}
|
||||
try:
|
||||
# 添加超时参数
|
||||
rjson = requests.get(url, headers=headers, timeout=10).json()
|
||||
rjson = requests.get(url, headers=headers, timeout=(5, 15)).json()
|
||||
if (rjson['code'] == 200):
|
||||
return rjson['data']
|
||||
else:
|
||||
@@ -90,7 +90,7 @@ class QL:
|
||||
headers = {"Authorization": self.auth, "content-type": "application/json"}
|
||||
try:
|
||||
# 添加超时参数
|
||||
rjson = requests.post(url, headers=headers, data=jsonDumps(envs), timeout=10).json()
|
||||
rjson = requests.post(url, headers=headers, data=jsonDumps(envs), timeout=(5, 15)).json()
|
||||
if (rjson['code'] == 200):
|
||||
self.log(f"新建环境变量成功:{len(envs)}")
|
||||
return True
|
||||
@@ -109,7 +109,7 @@ class QL:
|
||||
headers = {"Authorization": self.auth, "content-type": "application/json"}
|
||||
try:
|
||||
# 添加超时参数
|
||||
rjson = requests.put(url, headers=headers, data=jsonDumps(env), timeout=10).json()
|
||||
rjson = requests.put(url, headers=headers, data=jsonDumps(env), timeout=(5, 15)).json()
|
||||
if (rjson['code'] == 200):
|
||||
self.log(f"更新环境变量成功")
|
||||
return True
|
||||
|
||||
Reference in New Issue
Block a user