统一转本地时间
This commit is contained in:
@@ -29,27 +29,35 @@ namespace DOAN.ServiceCore.Middleware
|
||||
/// <returns></returns>
|
||||
public override Task OnActionExecutionAsync(ActionExecutingContext context, ActionExecutionDelegate next)
|
||||
{
|
||||
string msg = string.Empty;
|
||||
var values = context.ModelState.Values;
|
||||
foreach (var item in values)
|
||||
{
|
||||
foreach (var err in item.Errors)
|
||||
// 打印请求参数
|
||||
|
||||
|
||||
|
||||
|
||||
string msg = string.Empty;
|
||||
var values = context.ModelState.Values;
|
||||
foreach (var item in values)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(msg))
|
||||
foreach (var err in item.Errors)
|
||||
{
|
||||
msg += " | ";
|
||||
if (!string.IsNullOrEmpty(msg))
|
||||
{
|
||||
msg += " | ";
|
||||
}
|
||||
|
||||
msg += err.ErrorMessage;
|
||||
}
|
||||
|
||||
msg += err.ErrorMessage;
|
||||
}
|
||||
}
|
||||
if (!string.IsNullOrEmpty(msg))
|
||||
{
|
||||
logger.Info($"请求参数错误,{msg}");
|
||||
ApiResult response = new((int)ResultCode.PARAM_ERROR, msg);
|
||||
if (!string.IsNullOrEmpty(msg))
|
||||
{
|
||||
logger.Info($"请求参数错误,{msg}");
|
||||
ApiResult response = new((int)ResultCode.PARAM_ERROR, msg);
|
||||
|
||||
context.Result = new JsonResult(response);
|
||||
}
|
||||
context.Result = new JsonResult(response);
|
||||
}
|
||||
|
||||
|
||||
|
||||
return base.OnActionExecutionAsync(context, next);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user