修改问题
This commit is contained in:
parent
add717cbf6
commit
a2d4a58b6b
|
|
@ -31,16 +31,24 @@ public class CustomResultFilter : IResultFilter
|
|||
/// </summary>
|
||||
/// <param name="context"></param>
|
||||
public void OnResultExecuting(ResultExecutingContext context)
|
||||
{
|
||||
if (context.Result is ObjectResult objectResult)
|
||||
{
|
||||
if (objectResult.Value == null)
|
||||
{
|
||||
BaseResponse<string> baseStringResponse = new BaseResponse<string>(ResponseCode.Success, "", null);
|
||||
objectResult.Value = baseStringResponse.ToString();
|
||||
return;
|
||||
}
|
||||
|
||||
// 获取当前用户的信息
|
||||
if (objectResult.Value != null)
|
||||
{
|
||||
var httpContext = context.HttpContext;
|
||||
var path = httpContext.Request.Path.Value ?? "";
|
||||
var apiPrefix = path.Replace('/', '.').TrimStart('.');
|
||||
var sw = Stopwatch.StartNew();
|
||||
CloudGamingBase cloudGamingBase = new CloudGamingBase(_serviceProvider);
|
||||
//// 获取当前用户的信息
|
||||
//var user = httpContext.User.Identity.IsAuthenticated ? httpContext.User.Identity.Name : "Anonymous";
|
||||
if (context.Result is ObjectResult objectResult && objectResult.Value != null)
|
||||
{
|
||||
var x = objectResult.Value.GetType();
|
||||
object? value = null;
|
||||
if (!x.FullName.Contains("HuanMeng.DotNetCore.Base.BaseResponse"))
|
||||
|
|
@ -94,6 +102,8 @@ public class CustomResultFilter : IResultFilter
|
|||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 结果发送到客户端后
|
||||
/// </summary>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user