feat: 为核心业务 API 全面挂载审计日志装饰器

This commit is contained in:
DXC
2026-03-10 17:16:57 +08:00
parent aeea3fc25c
commit ea28ee1c86
7 changed files with 107 additions and 7 deletions

View File

@ -1,7 +1,7 @@
from flask import Blueprint, request, jsonify
from app.services.outbound_service import OutboundService
from flask_jwt_extended import jwt_required, get_jwt_identity, get_jwt
from app.utils.decorators import permission_required
from app.utils.decorators import permission_required, audit_log
from app.services.auth_service import AuthService
import traceback
@ -107,6 +107,11 @@ def scan_barcode():
# --------------------------------------------------------
@outbound_bp.route('', methods=['POST'])
@jwt_required()
@audit_log(
module='出库管理',
action='新增',
get_target_name_fn=lambda: request.get_json().get('order_no') if request.get_json() else None
)
def create_outbound():
# 权限检查:需要 outbound_create:operation 或 outbound_selection:operation 之一
claims = get_jwt()