🚨修复无法json.dump的问题

This commit is contained in:
qwerdvd 2023-08-11 23:01:43 +08:00
parent 1b36e462c5
commit ad12bbe4e2

View File

@ -1,6 +1,7 @@
import asyncio
import json
import msgspec
from gsuid_core.data_store import get_res_path
from gsuid_core.utils.error_reply import get_error
from gsuid_core.utils.image.convert import convert_img
@ -18,8 +19,7 @@ async def get_role_img(sr_uid: str):
status = player_info.status
uid = status.uid
player_save_path = get_res_path(['ArknightsUID', 'player'])
player_save_path = get_res_path(['ArknightsUID', 'players'])
with open(player_save_path / f'{uid}.json', 'w', encoding='UTF-8') as f:
json.dump(player_info, f, ensure_ascii=False, indent=4)
json.dump(json.loads(msgspec.json.encode(player_info)), f, ensure_ascii=False, indent=4)