replace screenshot pipeline and update admin
This commit is contained in:
@@ -295,6 +295,21 @@ def get_ip_risk(ip):
|
||||
)
|
||||
|
||||
|
||||
@security_bp.route("/api/admin/security/ip-risk/clear", methods=["POST"])
|
||||
@admin_required
|
||||
def clear_ip_risk():
|
||||
"""清除指定IP的风险分"""
|
||||
data = _parse_json()
|
||||
ip_text = str(data.get("ip") or "").strip()
|
||||
if not ip_text:
|
||||
return jsonify({"error": "ip不能为空"}), 400
|
||||
|
||||
if not scorer.reset_ip_score(ip_text):
|
||||
return jsonify({"error": "清理失败"}), 400
|
||||
|
||||
return jsonify({"success": True, "ip": _truncate(ip_text, 64), "risk_score": 0})
|
||||
|
||||
|
||||
@security_bp.route("/api/admin/security/user-risk/<int:user_id>", methods=["GET"])
|
||||
@admin_required
|
||||
def get_user_risk(user_id):
|
||||
@@ -331,4 +346,3 @@ def cleanup_expired():
|
||||
pool_stats = None
|
||||
|
||||
return jsonify({"success": True, "pool_stats": pool_stats})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user