fix: Cookie批量删除路由顺序修正(/batch必须在/{task_id}前)+ Statistic valueStyle改为styles.content

This commit is contained in:
yml2213
2026-06-23 22:37:26 +08:00
parent 527c0c8ff8
commit 4a07905edf
4 changed files with 23 additions and 23 deletions
+17 -17
View File
@@ -124,23 +124,6 @@ def export_cookies(
)
@router.delete("/{task_id}")
def delete_cookie(
task_id: int,
db: Session = Depends(get_db),
current: User = Depends(require_permission("cookie:export")),
):
"""删除一条 Cookie 记录。"""
task = db.query(LoginTask).filter(LoginTask.id == task_id).first()
if not task:
raise HTTPException(status_code=404, detail="记录不存在")
task.cookie = ""
task.status = "failed"
task.message = "Cookie已清除"
db.commit()
return {"message": "已删除", "success": True}
@router.delete("/batch")
def delete_cookies_batch(
task_ids: str = "",
@@ -160,3 +143,20 @@ def delete_cookies_batch(
t.message = "Cookie已清除"
db.commit()
return {"message": f"已删除 {len(tasks)}", "deleted": len(tasks), "success": True}
@router.delete("/{task_id}")
def delete_cookie(
task_id: int,
db: Session = Depends(get_db),
current: User = Depends(require_permission("cookie:export")),
):
"""删除一条 Cookie 记录。"""
task = db.query(LoginTask).filter(LoginTask.id == task_id).first()
if not task:
raise HTTPException(status_code=404, detail="记录不存在")
task.cookie = ""
task.status = "failed"
task.message = "Cookie已清除"
db.commit()
return {"message": "已删除", "success": True}
+2 -2
View File
@@ -207,12 +207,12 @@ export default function AssignmentsPage() {
</Col>
<Col span={6}>
<Card size="small">
<Statistic title="已分配" value={assignedCount} valueStyle={{ color: token.colorSuccess }} prefix={<CheckCircleOutlined />} />
<Statistic title="已分配" value={assignedCount} styles={{ content: { color: token.colorSuccess } }} prefix={<CheckCircleOutlined />} />
</Card>
</Col>
<Col span={6}>
<Card size="small">
<Statistic title="未分配" value={unassignedCount} valueStyle={{ color: token.colorError }} prefix={<SwapOutlined />} />
<Statistic title="未分配" value={unassignedCount} styles={{ content: { color: token.colorError } }} prefix={<SwapOutlined />} />
</Card>
</Col>
<Col span={6}>
+2 -2
View File
@@ -255,7 +255,7 @@ export default function CookiePage() {
<Statistic
title="已分配"
value={assignedCount}
valueStyle={{ color: token.colorSuccess }}
styles={{ content: { color: token.colorSuccess } }}
/>
</Card>
</Col>
@@ -264,7 +264,7 @@ export default function CookiePage() {
<Statistic
title="未分配"
value={unassignedCount}
valueStyle={{ color: token.colorError }}
styles={{ content: { color: token.colorError } }}
/>
</Card>
</Col>
+2 -2
View File
@@ -35,12 +35,12 @@ export default function DashboardPage() {
</Col>
<Col span={6}>
<Card>
<Statistic title="成功" value={stats.success} valueStyle={{ color: token.colorSuccess }} />
<Statistic title="成功" value={stats.success} styles={{ content: { color: token.colorSuccess } }} />
</Card>
</Col>
<Col span={6}>
<Card>
<Statistic title="失败" value={stats.failed} valueStyle={{ color: token.colorError }} />
<Statistic title="失败" value={stats.failed} styles={{ content: { color: token.colorError } }} />
</Card>
</Col>
</Row>