mirror of
https://github.com/baiqwerdvd/ArknightsUID.git
synced 2025-05-05 03:23:45 +08:00
✨更优雅的方案
This commit is contained in:
parent
ad12bbe4e2
commit
f04eb222d3
@ -1,11 +1,6 @@
|
|||||||
import asyncio
|
|
||||||
import json
|
|
||||||
|
|
||||||
import msgspec
|
|
||||||
from gsuid_core.data_store import get_res_path
|
from gsuid_core.data_store import get_res_path
|
||||||
from gsuid_core.utils.error_reply import get_error
|
from gsuid_core.utils.error_reply import get_error
|
||||||
from gsuid_core.utils.image.convert import convert_img
|
from msgspec import json as msgjson
|
||||||
from PIL import Image
|
|
||||||
|
|
||||||
from ..utils.ark_api import ark_skd_api
|
from ..utils.ark_api import ark_skd_api
|
||||||
|
|
||||||
@ -21,5 +16,5 @@ async def get_role_img(sr_uid: str):
|
|||||||
|
|
||||||
player_save_path = get_res_path(['ArknightsUID', 'players'])
|
player_save_path = get_res_path(['ArknightsUID', 'players'])
|
||||||
|
|
||||||
with open(player_save_path / f'{uid}.json', 'w', encoding='UTF-8') as f:
|
with open(player_save_path / f'{uid}.json', 'wb') as file:
|
||||||
json.dump(json.loads(msgspec.json.encode(player_info)), f, ensure_ascii=False, indent=4)
|
file.write(msgjson.format(msgjson.encode(player_info), indent=4))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user