调试京东cookie设置

This commit is contained in:
liuwei
2025-05-15 15:54:40 +08:00
parent 26a1250430
commit abc86df2d9

View File

@@ -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: