diff --git a/modules/pay_log/log.py b/modules/pay_log/log.py index b6841853..2e7ca4d5 100644 --- a/modules/pay_log/log.py +++ b/modules/pay_log/log.py @@ -36,7 +36,7 @@ class PayLog: @staticmethod async def save_json(path, data: PayLogModel): async with aiofiles.open(path, "w", encoding="utf-8") as f: - return await f.write(data.json(ensure_ascii=False, indent=4, by_alias=True)) + return await f.write(data.model_dump_json(indent=4, by_alias=True)) def get_file_path( self, diff --git a/plugins/genshin/daily/material.py b/plugins/genshin/daily/material.py index 866a271f..bc7c0232 100644 --- a/plugins/genshin/daily/material.py +++ b/plugins/genshin/daily/material.py @@ -570,7 +570,7 @@ class DailyMaterial(Plugin): continue self.everyday_materials = _parse_honey_impact_source(response.content) # 当场缓存到文件 - content = self.everyday_materials.json(ensure_ascii=False, separators=(",", ":")) + content = self.everyday_materials.model_dump_json() async with aiofiles.open(DATA_FILE_PATH, "w", encoding="utf-8") as file: await file.write(content) logger.success("每日素材刷新成功")