From abc86df2d95e1af14a049d1c6100804eeef1d84e Mon Sep 17 00:00:00 2001 From: liuwei Date: Thu, 15 May 2025 15:54:40 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E8=AF=95=E4=BA=AC=E4=B8=9Ccookie?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/jd_sign_token/main.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/jd_sign_token/main.py b/plugins/jd_sign_token/main.py index 01f3a5d..6a3461f 100644 --- a/plugins/jd_sign_token/main.py +++ b/plugins/jd_sign_token/main.py @@ -250,9 +250,11 @@ class JDTokenPlugin(MessagePluginInterface): # 查找是否有相同备注的JD_COOKIE existing_env = None + env_id = None for env in envs: if env.get('name') == 'JD_COOKIE' and env.get('remarks') == remark: existing_env = env + env_id = env.get('id') break result = False @@ -260,7 +262,8 @@ class JDTokenPlugin(MessagePluginInterface): if existing_env: # 更新已存在的环境变量 existing_env['value'] = token - result = self.ql.updateEnv(existing_env) + env_update: dict = {'id': env_id, 'value': token, 'remarks': remark} + result = self.ql.updateEnv(env_update) if result: return f"✅ 已成功更新京东账号 [{remark}] 的Token" else: