mirror of
https://github.com/Megghy/MegghysAPI.git
synced 2025-12-06 22:26:56 +08:00
添加headerapi
This commit is contained in:
@@ -6,10 +6,15 @@ namespace MegghysAPI.Controllers
|
|||||||
[ApiController]
|
[ApiController]
|
||||||
public class PublicController : MControllerBase
|
public class PublicController : MControllerBase
|
||||||
{
|
{
|
||||||
[Route("header")]
|
[HttpGet("header")]
|
||||||
public IActionResult Header()
|
public IActionResult Header(bool? order = false)
|
||||||
{
|
{
|
||||||
return Ok(string.Join(",", context.Request.Headers.Keys));
|
var headers = Request.Headers.Select(h => $"{h.Key}: {h.Value}");
|
||||||
|
if (order == true)
|
||||||
|
{
|
||||||
|
headers = headers.OrderBy(h => h);
|
||||||
|
}
|
||||||
|
return Ok(string.Join(Environment.NewLine, headers));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ namespace MegghysAPI.Modules
|
|||||||
{
|
{
|
||||||
public static class PixivFavoriteDownloader
|
public static class PixivFavoriteDownloader
|
||||||
{
|
{
|
||||||
[AutoInit]
|
[AutoInit(Async = true)]
|
||||||
public static void Init()
|
public static void Init()
|
||||||
{
|
{
|
||||||
Favorites = DB.SQL.Select<PixivImgInfo>().ToList();
|
Favorites = DB.SQL.Select<PixivImgInfo>().ToList();
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ var builder = WebApplication.CreateBuilder(args);
|
|||||||
builder.Services.AddRazorComponents()
|
builder.Services.AddRazorComponents()
|
||||||
.AddInteractiveServerComponents();
|
.AddInteractiveServerComponents();
|
||||||
builder.Services.AddFluentUIComponents();
|
builder.Services.AddFluentUIComponents();
|
||||||
|
builder.Services.AddControllers();
|
||||||
|
|
||||||
var app = builder.Build();
|
var app = builder.Build();
|
||||||
|
|
||||||
@@ -29,9 +30,11 @@ app.MapStaticAssets();
|
|||||||
app.MapRazorComponents<App>()
|
app.MapRazorComponents<App>()
|
||||||
.AddInteractiveServerRenderMode();
|
.AddInteractiveServerRenderMode();
|
||||||
|
|
||||||
|
app.UseRouting();
|
||||||
|
|
||||||
|
app.UseAntiforgery();
|
||||||
|
|
||||||
app.MapControllers();
|
app.MapControllers();
|
||||||
app.MapBlazorHub();
|
|
||||||
app.MapFallbackToPage("/_Host");
|
|
||||||
|
|
||||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> AutoInitAttribute <20><><EFBFBD><EFBFBD>
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> AutoInitAttribute <20><><EFBFBD><EFBFBD>
|
||||||
// <20><>ȡ<EFBFBD><C8A1>ǰAssembly
|
// <20><>ȡ<EFBFBD><C8A1>ǰAssembly
|
||||||
|
|||||||
Reference in New Issue
Block a user