提交代码
This commit is contained in:
parent
145ae55d96
commit
bc92bdeab2
|
|
@ -22,7 +22,7 @@ namespace CloudGaming.Api.Controllers
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
public async Task<dynamic> GetConfig()
|
public async Task<dynamic> GetAppConfigAsync()
|
||||||
{
|
{
|
||||||
return new { test = "测试", Data = new { txt = "内部数据" } };
|
return new { test = "测试", Data = new { txt = "内部数据" } };
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,7 @@
|
||||||
},
|
},
|
||||||
"JwtTokenConfig": {
|
"JwtTokenConfig": {
|
||||||
//加密字段
|
//加密字段
|
||||||
"secret": "XtrtwJIcxRHWInEMsCyUdwcRKLNHHAcQ1",
|
"secret": "2C9AF5B22C94DB24A4FEB26BBF01C9AB",
|
||||||
//发行人
|
//发行人
|
||||||
"issuer": "steamcloud.co",
|
"issuer": "steamcloud.co",
|
||||||
//受众
|
//受众
|
||||||
|
|
|
||||||
|
|
@ -12,16 +12,18 @@ namespace CloudGaming.Code.AppExtend
|
||||||
{
|
{
|
||||||
private readonly IHttpContextAccessor _httpContextAccessor;
|
private readonly IHttpContextAccessor _httpContextAccessor;
|
||||||
|
|
||||||
public CustomResultFilter(IHttpContextAccessor httpContextAccessor)
|
private readonly AppConfig _appConfig;
|
||||||
|
public CustomResultFilter(IHttpContextAccessor httpContextAccessor, AppConfig appConfig)
|
||||||
{
|
{
|
||||||
_httpContextAccessor = httpContextAccessor;
|
_httpContextAccessor = httpContextAccessor;
|
||||||
|
_appConfig = appConfig;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnResultExecuting(ResultExecutingContext context)
|
public void OnResultExecuting(ResultExecutingContext context)
|
||||||
{
|
{
|
||||||
// 获取当前的 HttpContext
|
// 获取当前的 HttpContext
|
||||||
var httpContext = context.HttpContext;
|
var httpContext = context.HttpContext;
|
||||||
|
var path = httpContext.Request.Path.Value ?? "";
|
||||||
// 获取当前用户的信息
|
// 获取当前用户的信息
|
||||||
var user = httpContext.User.Identity.IsAuthenticated ? httpContext.User.Identity.Name : "Anonymous";
|
var user = httpContext.User.Identity.IsAuthenticated ? httpContext.User.Identity.Name : "Anonymous";
|
||||||
|
|
||||||
|
|
@ -35,7 +37,7 @@ namespace CloudGaming.Code.AppExtend
|
||||||
|
|
||||||
}
|
}
|
||||||
// 递归处理返回对象的所有属性并打印路径
|
// 递归处理返回对象的所有属性并打印路径
|
||||||
ProcessObjectProperties(objectResult.Value, user, language, "");
|
ProcessObjectProperties(objectResult.Value, user, language, path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user