修复抽卡记录

This commit is contained in:
CMHopeSunshine 2022-11-22 15:54:52 +08:00
parent 5ab41933d2
commit da5b96b625
2 changed files with 2 additions and 2 deletions

View File

@ -151,7 +151,7 @@ async def draw_four_star(info: FourStarItem) -> PMImage:
async def draw_four_star_detail(data: List[FourStarItem]):
data.sort(key=lambda x: sum(x.num['角色祈愿'] + x.num['武器祈愿'] + x.num['常驻祈愿'] + x.num['新手祈愿']), reverse=True)
data.sort(key=lambda x: x.num['角色祈愿'] + x.num['武器祈愿'] + x.num['常驻祈愿'] + x.num['新手祈愿'], reverse=True)
bar = await load_image(RESOURCE_BASE_PATH / 'gacha_log' / 'four_star_bar.png')
total_height = 105 + 260 * math.ceil(len(data) / 5)
bg = PMImage(size=(1008, total_height), mode='RGBA', color=(255, 255, 255, 0))

View File

@ -420,7 +420,7 @@ async def get_authkey_by_stoken(user_id: str, uid: str) -> Tuple[Optional[str],
'game_uid': uid,
'region': server_id})
data = data.json()
if 'data' in data and 'authkey' in data['data']:
if data.get('data') is not None and 'authkey' in data['data']:
return data['data']['authkey'], True, cookie_info
else:
return None, False, cookie_info