mirror of
https://github.com/PaiGramTeam/MibooGram.git
synced 2024-11-16 04:45:27 +00:00
🔧 修复 Cookies
数据库部分无法读取或写入
This commit is contained in:
parent
13abae5a19
commit
5eb741070d
@ -23,6 +23,7 @@ class CookiesRepository:
|
||||
else:
|
||||
raise RegionNotFoundError(region.name)
|
||||
await session.add(db_data)
|
||||
await session.commit()
|
||||
|
||||
async def update_cookies(self, user_id: int, cookies: str, region: RegionEnum):
|
||||
async with self.mysql.Session() as session:
|
||||
@ -34,7 +35,7 @@ class CookiesRepository:
|
||||
if db_cookies is None:
|
||||
raise CookiesNotFoundError(user_id)
|
||||
db_cookies.cookie = cookies
|
||||
session.add(db_cookies)
|
||||
await session.add(db_cookies)
|
||||
await session.commit()
|
||||
await session.refresh(db_cookies)
|
||||
elif region == RegionEnum.HOYOLAB:
|
||||
@ -44,7 +45,7 @@ class CookiesRepository:
|
||||
if db_cookies is None:
|
||||
raise CookiesNotFoundError(user_id)
|
||||
db_cookies.cookie = cookies
|
||||
session.add(db_cookies)
|
||||
await session.add(db_cookies)
|
||||
await session.commit()
|
||||
await session.refresh(db_cookies)
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user