🐛 修复 cookies 数据时写入前注册信息判断错误的逻辑问题

This commit is contained in:
洛水居室 2022-09-09 19:30:02 +08:00
parent ec8d70a434
commit b5fad5cf66
No known key found for this signature in database
GPG Key ID: C9DE87DA724B88FC

View File

@ -24,7 +24,7 @@ from utils.models.base import RegionEnum
class AddUserCommandData(TelegramObject): class AddUserCommandData(TelegramObject):
user: Optional[User] = None user: Optional[User] = None
cookies_database_data: Optional[Cookies] = None cookies_database_data: Optional[Cookies] = None
region: RegionEnum = RegionEnum.HYPERION region: RegionEnum = RegionEnum.NULL
cookies: dict = {} cookies: dict = {}
game_uid: int = 0 game_uid: int = 0
@ -84,7 +84,7 @@ class SetUserCookies(Plugin.Conversation, BasePlugin.Conversation):
user_info = None user_info = None
if user_info is not None: if user_info is not None:
try: try:
cookies_database_data = await self.cookies_service.get_cookies(user.id, add_user_command_data.region) cookies_database_data = await self.cookies_service.get_cookies(user.id, region)
add_user_command_data.cookies_database_data = cookies_database_data add_user_command_data.cookies_database_data = cookies_database_data
except CookiesNotFoundError: except CookiesNotFoundError:
await message.reply_text("你已经绑定UID如果继续操作会覆盖当前UID。") await message.reply_text("你已经绑定UID如果继续操作会覆盖当前UID。")