fix vali middleware

This commit is contained in:
HTR
2018-07-02 18:15:35 +08:00
parent 2e19235619
commit 1b5155aeaa
14 changed files with 358 additions and 226 deletions
@@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using COMCMS.Web.Common;
using COMCMS.Web.Controllers.api;
using Lib.Core.MiddlewareExtension;
using Microsoft.AspNetCore.Http;
namespace COMCMS.Web.ExceptionHandler
{
public class ResultExceptionHandler : IExceptionHandler
{
public async Task ExceptionHandle(HttpContext context, Exception exception)
{
string message = exception.Message;
ReJSON error = new ReJSON(message);
await context.Response.WriteAsync(error.ToJson());
}
}
}