|
|
@@ -1,6 +1,9 @@ |
|
|
|
using BPA.SAAS.Manage.Application.AExternalPlatform.BaseDto; |
|
|
|
using BPA.KitChen.GroupMeal.SqlSugar; |
|
|
|
using BPA.SAAS.KitChenManage.Core; |
|
|
|
using BPA.SAAS.Manage.Application.AExternalPlatform.BaseDto; |
|
|
|
using BPA.SAAS.Manage.Application.AExternalPlatform.Enum; |
|
|
|
using BPA.SAAS.Manage.Application.AExternalPlatform.Service.CheckService.Services; |
|
|
|
using BPA.SAAS.Manage.Core.System; |
|
|
|
using Furion; |
|
|
|
using Furion.EventBus; |
|
|
|
using Furion.FriendlyException; |
|
|
@@ -46,6 +49,12 @@ namespace BPA.SAAS.Manage.Web.Core |
|
|
|
// 获取来源 Url 地址 |
|
|
|
var refererUrl = httpRequest.GetRefererUrlAddress(); |
|
|
|
|
|
|
|
// 获取控制器、路由信息 |
|
|
|
var actionDescriptor = context.ActionDescriptor as ControllerActionDescriptor; |
|
|
|
|
|
|
|
// 获取请求的方法 |
|
|
|
var method = actionDescriptor.MethodInfo; |
|
|
|
|
|
|
|
if (requestUrl.ToUpper().Contains("ExternalPlatform".ToUpper())) |
|
|
|
{ |
|
|
|
// 获取请求参数(写入日志,需序列化成字符串后存储) |
|
|
@@ -69,6 +78,22 @@ namespace BPA.SAAS.Manage.Web.Core |
|
|
|
|
|
|
|
// 判断是否请求成功,没有异常就是请求成功 |
|
|
|
var isRequestSucceed = actionContext.Exception == null; |
|
|
|
try |
|
|
|
{ |
|
|
|
await SqlSugarDb.Db.Insertable(new BPA_ThirdpartyRequestLog() |
|
|
|
{ |
|
|
|
CreateBy=DateTime.Now.ToString(), |
|
|
|
GroupId= CurrentUser.GroupId, |
|
|
|
RequestUrl= requestUrl, |
|
|
|
ReauestMethod= httpRequest.Method, |
|
|
|
ResultParm= returnResult == null ? "" : JsonConvert.SerializeObject(returnResult), |
|
|
|
IP= remoteIPv4 |
|
|
|
}).ExecuteCommandAsync(); |
|
|
|
|
|
|
|
} |
|
|
|
catch (Exception e) |
|
|
|
{ |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |