- black 格式化 (1 file) - isort 排序修复 (30 files, --profile black) - 升级 actions/checkout v4 → v6 (全部 3 个 workflow) - 添加 pyproject.toml (black/isort 配置) - isort CI 命令添加 --profile black 参数 - 114 测试全部通过 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
23 lines
673 B
Python
23 lines
673 B
Python
from __future__ import annotations
|
|
|
|
from typing import Any
|
|
|
|
from flask import jsonify, request
|
|
|
|
from outlook_web.audit import query_audit_logs
|
|
from outlook_web.security.auth import login_required
|
|
|
|
# ==================== 审计日志 API ====================
|
|
|
|
|
|
@login_required
|
|
def api_get_audit_logs() -> Any:
|
|
"""获取审计日志(敏感操作可追溯)"""
|
|
data = query_audit_logs(
|
|
limit=request.args.get("limit", type=int) or 50,
|
|
offset=request.args.get("offset", type=int) or 0,
|
|
action=request.args.get("action") or "",
|
|
resource_type=request.args.get("resource_type") or "",
|
|
)
|
|
return jsonify({"success": True, **data})
|