Fix AdminPanel json

This commit is contained in:
Дмитрий Шиманский
2023-12-22 21:36:21 +03:00
parent ede506cb5d
commit b91582a374
3 changed files with 10 additions and 9 deletions

View File

@@ -33,7 +33,8 @@
<div id="blogId" style="display:none;">@Model.Id</div>
<p align="center"><img src="@Post.ImageUrl" style="width:50vmax;"/></p>
<p align="center">@Html.Raw(Post.Text)</p>
<h6 align="left">Статья подготовлена <a href="https://discord.com/users/@Post.author.Id">@Post.author.discordNickName</a></h6>
string userId = "https://discord.com/users/"+Post.author.Id;
<h6 align="left">Статья подготовлена <a href="@userId">@Post.author.discordNickName</a></h6>
<div class="container my-5 py-5 bg-dark text-muted">
<div class="row d-flex justify-content-center">
<div class="col-md-12 col-lg-10">

View File

@@ -55,6 +55,7 @@ namespace yaflay.ru
.AddRazorPagesOptions(options =>
{
options.Conventions.AddPageRoute("/RobotsTxt", "/Robots.txt");
options.Conventions.AddPageRoute("/RobotsTxt", "/robots.txt");
options.Conventions.AddPageRoute("/NotFound", "/404");
options.Conventions.AddPageRoute("/IternalErrorPage", "/500");
options.Conventions.AddPageRoute("/Authorize", "/authorize");
@@ -71,6 +72,7 @@ namespace yaflay.ru
.AddRazorPagesOptions(options =>
{
options.Conventions.AddPageRoute("/RobotsTxt", "/Robots.txt");
options.Conventions.AddPageRoute("/RobotsTxt", "/robots.txt");
options.Conventions.AddPageRoute("/NotFound", "/404");
options.Conventions.AddPageRoute("/IternalErrorPage", "/500");
options.Conventions.AddPageRoute("/Authorize", "/authorize");
@@ -81,7 +83,7 @@ namespace yaflay.ru
services.AddCoreAdmin("admin");
#endif
}
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
// Add services to the container.
@@ -108,8 +110,6 @@ namespace yaflay.ru
endpoints.MapDefaultControllerRoute();
endpoints.MapRazorPages();
endpoints.MapControllers();
});
}

View File

@@ -12,11 +12,11 @@ function updateAnnotation(value) {
function sendArticleData () {
let melon = document.cookie.split(';')[0].replace("melon=", "");
let body = `{
title: ${$("#titleInput").val()},
annotation: ${$("#annotationArea").val()},
text: ${$("#textArea").val()},
image: ${$("#imgInput").val()},
author: ${melon}
title: "${$("#titleInput").val()}",
annotation: "${$("#annotationArea").val()}",
text: "${$("#textArea").val()}",
image: "${$("#imgInput").val()}",
author: "${melon}"
}`
fetch("/api/Blog", {
method: "POST",