diff --git a/NX.ERP.WebAPi/Filters/ExceptionFilter.cs b/NX.ERP.WebAPi/Filters/ExceptionFilter.cs index 6ce227d..78787dc 100644 --- a/NX.ERP.WebAPi/Filters/ExceptionFilter.cs +++ b/NX.ERP.WebAPi/Filters/ExceptionFilter.cs @@ -18,8 +18,8 @@ namespace NX.ERP.WebAPi.Filters var ex = actionExecutedContext.Exception; actionExecutedContext.Response = new System.Net.Http.HttpResponseMessage(); - actionExecutedContext.Response.Content = new System.Net.Http.ObjectContent(typeof(ResultModel), - new ResultModel { ErrCode = 500, ErrMsg = ex.Message, Data = null }, + actionExecutedContext.Response.Content = new System.Net.Http.ObjectContent(typeof(ResultModel), + new ResultModel { ErrCode = 500, ErrMsg = ex.Message }, GlobalConfiguration.Configuration.Formatters.JsonFormatter); return Task.FromResult(0); diff --git a/NX.ERP.WebAPi/ResultModel.cs b/NX.ERP.WebAPi/ResultModel.cs index 20596e7..d95b83f 100644 --- a/NX.ERP.WebAPi/ResultModel.cs +++ b/NX.ERP.WebAPi/ResultModel.cs @@ -5,10 +5,19 @@ using System.Web; namespace NX.ERP.WebAPi { - public class ResultModel + + + public class ResultModel { + public int ErrCode { get; set; } public string ErrMsg { get; set; } = ""; + } + + + public class ResultModel : ResultModel + { + public T Data { get; set; } } } \ No newline at end of file