临时提交

This commit is contained in:
2025-10-28 21:30:23 +08:00
parent 218e918ec0
commit 0c78a025f4
2 changed files with 5 additions and 8 deletions

View File

@@ -200,13 +200,10 @@ class JsonUtils:
return updated return updated
@classmethod @classmethod
def query_all_json_items(cls, filename="log/last_message.json") -> list: def query_all_json_items(cls, filename="log/last_message.json") -> list:
""" """
查询 JSON 文件(数组)中的所有项,并剔除 sender 为空的记录 查询 JSON 文件(数组)中的所有项,并剔除 sender 和 text 为空的记录
:param filename: JSON 文件路径 :param filename: JSON 文件路径
:return: list可能为空 :return: list可能为空
""" """
@@ -214,10 +211,9 @@ class JsonUtils:
data = cls._read_json_list(file_path) data = cls._read_json_list(file_path)
if not isinstance(data, list): if not isinstance(data, list):
return [] return []
# 过滤 sender 为空字符串的项 # 过滤 sender 和 text 为空字符串的项
# return [item for item in data if isinstance(item, dict) and item.get("sender", "").strip()] return [item for item in data if
return [item for item in data if isinstance(item, dict)] isinstance(item, dict) and item.get("sender", "").strip() and item.get("text", "").strip()]
@classmethod @classmethod

View File

@@ -1635,6 +1635,7 @@ class ScriptManager():
LogManager.method_info(f"点击坐标: ({tap_x}, {tap_y}),账号: {target_account}", "切换账号", udid) LogManager.method_info(f"点击坐标: ({tap_x}, {tap_y}),账号: {target_account}", "切换账号", udid)
session.tap(tap_x, tap_y) session.tap(tap_x, tap_y)
time.sleep(5)
return 200, "成功" return 200, "成功"
except Exception as e: except Exception as e: