From 0c78a025f4d07a456e55fd8faf8607e5e0a7e435 Mon Sep 17 00:00:00 2001 From: milk <53408947@qq.com> Date: Tue, 28 Oct 2025 21:30:23 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=B4=E6=97=B6=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Utils/JsonUtils.py | 12 ++++-------- script/ScriptManager.py | 1 + 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/Utils/JsonUtils.py b/Utils/JsonUtils.py index f36e9ba..46d8fa7 100644 --- a/Utils/JsonUtils.py +++ b/Utils/JsonUtils.py @@ -200,13 +200,10 @@ class JsonUtils: return updated - - - @classmethod def query_all_json_items(cls, filename="log/last_message.json") -> list: """ - 查询 JSON 文件(数组)中的所有项,并剔除 sender 为空的记录 + 查询 JSON 文件(数组)中的所有项,并剔除 sender 和 text 为空的记录 :param filename: JSON 文件路径 :return: list,可能为空 """ @@ -214,10 +211,9 @@ class JsonUtils: data = cls._read_json_list(file_path) if not isinstance(data, list): return [] - # 过滤 sender 为空字符串的项 - # return [item for item in data if isinstance(item, dict) and item.get("sender", "").strip()] - return [item for item in data if isinstance(item, dict)] - + # 过滤 sender 和 text 为空字符串的项 + return [item for item in data if + isinstance(item, dict) and item.get("sender", "").strip() and item.get("text", "").strip()] @classmethod diff --git a/script/ScriptManager.py b/script/ScriptManager.py index 2029ff4..e8b7cbc 100644 --- a/script/ScriptManager.py +++ b/script/ScriptManager.py @@ -1635,6 +1635,7 @@ class ScriptManager(): LogManager.method_info(f"点击坐标: ({tap_x}, {tap_y}),账号: {target_account}", "切换账号", udid) session.tap(tap_x, tap_y) + time.sleep(5) return 200, "成功" except Exception as e: