This commit is contained in:
2025-05-07 16:33:57 +08:00
parent ab7ae290f0
commit 9a9fd29e1e
5 changed files with 15 additions and 2 deletions

View File

@@ -11,9 +11,9 @@
public string Name { get; set; } = "我的博客";
public string Logo { get; set; } = "https://img.yescent.com/FosQ9ua_nPhlNQwYgJwUXi9MFsB5.jpg";
public string Logo { get; set; } = "";
public string Url { get; set; } = "https://yescent.com";
public string Url { get; set; } = "https://blog.yescent.com";
public int PageSizeOfHomepage { get; set; } = 5;

View File

@@ -17,5 +17,13 @@ namespace Yes.Domain.Core.Extensions
}
return ipAddress ?? "";
}
public static string GetCurrentDomain(this HttpContext httpContext)
{
var request = httpContext.Request;
var host = request.Headers["X-Forwarded-Host"].FirstOrDefault() ?? request.Host.Host;
var protocol = request.Headers["X-Forwarded-Proto"].FirstOrDefault() ?? request.Scheme;
return $"{protocol}://{host}";
}
}
}