From e187f4e58ac1cd08d14a2a91d4d752227333fee3 Mon Sep 17 00:00:00 2001 From: liuwei Date: Mon, 26 May 2025 09:21:24 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E8=AF=95=E4=B8=80=E4=B8=8Bjd=EF=BC=8C?= =?UTF-8?q?=E8=B6=85=E6=97=B6=E9=97=AE=E9=A2=98=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin/dashboard/server.py | 6 +++++- plugins/jd_sign_token/main.py | 8 ++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/admin/dashboard/server.py b/admin/dashboard/server.py index fa35ab9..64850f6 100644 --- a/admin/dashboard/server.py +++ b/admin/dashboard/server.py @@ -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": "未获取到用户数据"} diff --git a/plugins/jd_sign_token/main.py b/plugins/jd_sign_token/main.py index 1a49ff3..7cd5fdc 100644 --- a/plugins/jd_sign_token/main.py +++ b/plugins/jd_sign_token/main.py @@ -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