2024年1月15日发(作者:)
private string GetExceptionRequestBody(ExceptionContext context) { string requestBody = ""; if (context != null) { var request = context?.HttpContext?.Request; if (request != null) { on = 0; StreamReader stream = new StreamReader(); requestBody = End(); on = 0; } } return requestBody; } } public class ActionFilter : IActionFilter { private Stopwatch timer; [Import] private IAduitService aduitService { get; set; } public ActionFilter(IoC ioc) { e(this); } public void OnActionExecuting(ActionExecutingContext context) { = new Stopwatch(); (); } public void OnActionExecuted(ActionExecutedContext context) { (); ApiAction(GetActionDescriptor(context)); } private ApiActionDescriptorModel GetActionDescriptor(ActionExecutedContext context) { ApiActionDescriptorModel descriptor = new ApiActionDescriptorModel();
var userInfo= ((Identity)ty).Claims?.ToList(); if (context != null) { Name = ((ControllerActionDescriptor)Descriptor)?.ActionName; llerName = ((ControllerActionDescriptor)Descriptor)?.ControllerName; tIp = ng(); tPort = ng(); thod = ng(); Time = dMilliseconds; or = userInfo?.Where(t => == "UserName")?.FirstOrDefault()?.Value; = userInfo?.Where(t => == "UserId")?.FirstOrDefault()?.Value; ime = ; tBody = ReadActionExcutedRequestBody(context); tring = t?.ng(); eBody = GetActionExcutedResponseBody(context); eStatusCode = Code; } return descriptor; } private string ReadActionExcutedRequestBody(ActionExecutedContext context) { string requestBody = ""; if (context != null) { var request = t; on = 0; StreamReader stream = new StreamReader(); requestBody = End(); on = 0; } return requestBody; }
e = ime; = e("localhost", "127.0.0.1"); seCode = responseCode; ype = ype; = >(txt); foreach (var item in jObjects) (ties().ToDictionary(x => , y => ng())); } else { NameValueCollection collection = ueryString(txt); var dic = new Dictionary
se(ntentBetweenTwoRegex(resposeBody, "code":", ","), out responseCode); return responseCode; } private List>(tBody); else jObjects = new List
for (int i = 1; i < ; i++) { try { ( eplace(rules[i], "【.*?】", "【" + jObject[ntentBetweenTwoRegex(rules[i], @"【${", "}】")].ToString() + "】" )); } catch (Exception ex) { ("在" + rules[i] + "查找失败,具体原因:" + ng()); throw; } } return sb; } public static string[] FindByRegexRemoveRegexs(string html, string strReg, string remReg) { string[] strs = FindByRegex(html, strReg); List


发布评论