mirror of
https://github.com/suyiiyii/nonebot-bison.git
synced 2026-05-10 10:47:56 +08:00
✨ WebUI 中,允许查看 Cookie 的 content
This commit is contained in:
@@ -211,12 +211,12 @@ async def update_weigth_config(platformName: str, target: str, weight_config: We
|
||||
|
||||
@router.get("/cookie", dependencies=[Depends(check_is_superuser)])
|
||||
async def get_cookie(site_name: str = None, target: str = None) -> list[Cookie]:
|
||||
# todo: 调用 client_mgr 来添加cookie,以校验和获取cookie_name
|
||||
cookies_in_db = await config.get_cookie(site_name, is_anonymous=False)
|
||||
return [
|
||||
Cookie(
|
||||
id=cookies_in_db[i].id,
|
||||
friendly_name=cookies_in_db[i].cookie_name,
|
||||
content=cookies_in_db[i].content,
|
||||
cookie_name=cookies_in_db[i].cookie_name,
|
||||
site_name=cookies_in_db[i].site_name,
|
||||
last_usage=cookies_in_db[i].last_usage,
|
||||
status=cookies_in_db[i].status,
|
||||
|
||||
@@ -75,7 +75,8 @@ class Target(BaseModel):
|
||||
class Cookie(BaseModel):
|
||||
id: int
|
||||
site_name: str
|
||||
friendly_name: str
|
||||
content: str
|
||||
cookie_name: str
|
||||
last_usage: datetime
|
||||
status: str
|
||||
cd_milliseconds: int
|
||||
|
||||
Reference in New Issue
Block a user