From cdb68df72d1db590c444a4c8f40e77aa1ccfa86c Mon Sep 17 00:00:00 2001 From: liuwei Date: Mon, 12 May 2025 16:55:07 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B8=85=E9=99=A4=E6=97=A0=E6=95=88=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=EF=BC=8C=E8=B0=83=E6=95=B4token=E9=9C=80=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/jd_sign_token/main.py | 7 +++++++ plugins/weather/main.py | 1 - 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/plugins/jd_sign_token/main.py b/plugins/jd_sign_token/main.py index 4e653bd..9df3485 100644 --- a/plugins/jd_sign_token/main.py +++ b/plugins/jd_sign_token/main.py @@ -219,6 +219,13 @@ class JDTokenPlugin(MessagePluginInterface): # 提取token和备注 token = match.group(1) remark = match.group(2) + + # 简单预检查token格式 + if not token.startswith("pt_key=") or "pt_pin=" not in token: + await bot.send_text_message((roomid if roomid else sender), + f"❌ Token格式错误!正确格式应为:pt_key=xxx; pt_pin=xxx;", + sender) + return False, "Token格式错误" try: # 设置京东Token diff --git a/plugins/weather/main.py b/plugins/weather/main.py index dbcff4f..6db36e5 100644 --- a/plugins/weather/main.py +++ b/plugins/weather/main.py @@ -218,7 +218,6 @@ class WeatherPlugin(MessagePluginInterface): now_uvindex = weather_forecast_api_json['daily'][0]['uvIndex'] message = ( - f"-----fgwx-----\n" f"{country}{adm1}{adm2} 实时天气☁️\n" f"⏰更新时间:{update_time}\n\n" f"🌡️当前温度:{now_temperature}℃\n"