public override async Task Invoke(AspectContext context, AspectDelegate next)
 {
     try
     {
         await context.Invoke(next);
     }
     catch (Exception ex)
     {
         if (!ex.Message.EndsWith($"-{ReturnedStatus.AbnormalCode}."))
         {
             var logService = FrameWorkService.ServiceProvider.GetService <ISysAbnormalLogService>();
             var log        = new Sys_AbnormalLog();
             log.Body         = context.Parameters.ObjectToJson();
             log.ErrorMessage = ex.ToString();
             log.RequestUrl   = context.ImplementationMethod.ReflectedType.FullName + "." + context.ImplementationMethod.Name;
             log.ClientIp     = FrameWorkService.ServiceProvider.GetService <IHttpContextAccessor>().HttpContext.Connection.RemoteIpAddress.ToString();
             log.SetUserToModelCreate();
             var id           = logService.InsertReturnIdentity(log);
             var returnedData = new ReturnedDataResult()
             {
                 Status  = ReturnedStatus.AbnormalCode,
                 Message = $"请联系开发人员 logid:{id}!"
             };
             ////创建并返回继承自ReturnedResult的return对象
             if (context.ProxyMethod.ReturnType == typeof(ReturnedDataResult))
             {
                 context.ReturnValue = returnedData;
             }
             else
             {
                 throw new Exception($"@{returnedData.Message}-{ returnedData.Status }");
             }
         }
         else
         {
             if (context.ProxyMethod.ReturnType == typeof(ReturnedDataResult))
             {
                 context.ReturnValue = new ReturnedDataResult()
                 {
                     Status  = ReturnedStatus.AbnormalCode,
                     Message = ex.Message.Substring(ex.Message.IndexOf("@") + 1).Replace($"-{ReturnedStatus.AbnormalCode}.", string.Empty)
                 };
             }
             else
             {
                 throw new Exception(ex.Message);
             }
         }
     }
 }
        /// <summary>
        /// 异常返回 控制器异常
        /// </summary>
        /// <param name="actionContext"></param>
        public void OnException(ExceptionContext context)
        {
            var id = 0;

            if (context.Exception != null)
            {
                var logService = FrameWorkService.ServiceProvider.GetService <ISysAbnormalLogService>();
                var log        = new Sys_AbnormalLog();
                log.Body         = "";
                log.ErrorMessage = context.Exception.ToString();
                log.RequestUrl   = context.HttpContext.Request.Path;
                log.ClientIp     = string.Empty;
                log.SetUserToModelCreate();
                id = logService.InsertReturnIdentity(log);
            }
            var returnedData = new ReturnedDataResult()
            {
                Status  = ReturnedStatus.Error,
                Message = $"请联系开发人员 logid:{id}!"
            };

            context.Result = new JsonResult(returnedData);
        }