feat(cookies): CK 有效性检测(双接口) + 结果持久化
- 检测: 鱼丸余额(fishBall) + 用户等级(userLevelDetail)双接口均通过才判有效, 附带鱼丸数/昵称/等级, 失败时分别说明原因, 8 并发批量检测 - 持久化: login_tasks 新增 ck_check_status/ck_check_result/ck_checked_at, 刷新翻页不丢失; 列表与详情接口返回检测字段 - 前端: 新增"有效性"列(有效/无效+鱼丸昵称tooltip)与独立"检测时间"列, 行内/选中批量检测按钮(cookie:view 权限), 加载时初始化历史检测结果
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
"""斗鱼 Cookie 有效性检测结果持久化字段
|
||||
|
||||
Revision ID: 20260807_0018
|
||||
Revises: 20260807_0017
|
||||
Create Date: 2026-08-07
|
||||
"""
|
||||
|
||||
from typing import Sequence, Union
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
revision: str = "20260807_0018"
|
||||
down_revision: Union[str, None] = "20260807_0017"
|
||||
branch_labels: Union[str, Sequence[str], None] = None
|
||||
depends_on: Union[str, Sequence[str], None] = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
bind = op.get_bind()
|
||||
if not sa.inspect(bind).has_table("login_tasks"):
|
||||
return
|
||||
columns = {column["name"] for column in sa.inspect(bind).get_columns("login_tasks")}
|
||||
for column in [
|
||||
sa.Column("ck_check_status", sa.String(length=16), nullable=True),
|
||||
sa.Column("ck_check_result", sa.JSON(), nullable=True),
|
||||
sa.Column("ck_checked_at", sa.DateTime(), nullable=True),
|
||||
]:
|
||||
if column.name not in columns:
|
||||
op.add_column("login_tasks", column)
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
bind = op.get_bind()
|
||||
if not sa.inspect(bind).has_table("login_tasks"):
|
||||
return
|
||||
columns = {column["name"] for column in sa.inspect(bind).get_columns("login_tasks")}
|
||||
for column_name in ["ck_checked_at", "ck_check_result", "ck_check_status"]:
|
||||
if column_name in columns:
|
||||
op.drop_column("login_tasks", column_name)
|
||||
Reference in New Issue
Block a user