懒得勤快 3 lat temu
rodzic
commit
91fd6d38a9

+ 9 - 7
src/Masuit.MyBlogs.Core/Views/Home/Index.cshtml

@@ -4,6 +4,7 @@
 @using Masuit.MyBlogs.Core.Models.DTO
 @using Masuit.MyBlogs.Core.Models.Entity
 @using Masuit.MyBlogs.Core.Models.ViewModel
+@using Masuit.Tools
 @using Masuit.Tools.Core.Net
 @using Microsoft.AspNetCore.Http
 @model Masuit.MyBlogs.Core.Models.ViewModel.HomePageViewModel
@@ -12,25 +13,26 @@
     Layout = "~/Views/Shared/_Layout.cshtml";
     PooledList<FastShare> shares = ViewBag.FastShare;
     Context.Request.Path = new PathString("/posts");
+    var sliderid = Stopwatch.GetTimestamp().ToBinary(62);
 }
 <link href="~/Assets/banner/bootstrap-touch-slider.css" rel="stylesheet" />
 @if (Model.Banner.Any())
 {
-    <div id="bootstrap-touch-slider" class="carousel bs-slider fade  control-round indicators-line" data-ride="carousel" data-pause="hover" data-interval="5000" id="@Stopwatch.GetTimestamp()">
+    <div id="@sliderid" class="carousel bs-slider fade  control-round indicators-line" data-ride="carousel" data-pause="hover" data-interval="5000" id="@Stopwatch.GetTimestamp()">
         <ol class="carousel-indicators">
             @for (int i = 0; i < Model.Banner.Count; i++)
             {
                 if (i == 0)
                 {
-                    <li data-target="#bootstrap-touch-slider" data-slide-to="@i" class="active"></li>
+                    <li data-target="#@sliderid" data-slide-to="@i" class="active"></li>
                 }
                 else
                 {
-                    <li data-target="#bootstrap-touch-slider" data-slide-to="@i"></li>
+                    <li data-target="#@sliderid" data-slide-to="@i"></li>
                 }
             }
         </ol>
-        <div class="carousel-inner" role="listbox" id="@Stopwatch.GetTimestamp()">
+        <div class="carousel-inner" id="@Stopwatch.GetTimestamp()">
             @for (int i = 0; i < Model.Banner.Count; i++)
             {
                 var p = Model.Banner[i];
@@ -43,11 +45,11 @@
                 </div>
             }
         </div>
-        <a class="left carousel-control" href="#bootstrap-touch-slider" role="button" data-slide="prev">
+        <a class="left carousel-control" href="#@sliderid" role="button" data-slide="prev">
             <span class="fa fa-angle-left" aria-hidden="true"></span>
             <span class="sr-only">上一个</span>
         </a>
-        <a class="right carousel-control" href="#bootstrap-touch-slider" role="button" data-slide="next">
+        <a class="right carousel-control" href="#@sliderid" role="button" data-slide="next">
             <span class="fa fa-angle-right" aria-hidden="true"></span>
             <span class="sr-only">下一个</span>
         </a>
@@ -121,5 +123,5 @@
     await Html.RenderPartialAsync(user.IsAdmin ? "_MainContainer_Admin" : "_MainContainer", Model);
 }
 <script type="text/javascript">
-    $('#bootstrap-touch-slider').bsTouchSlider();
+    $('#@sliderid').bsTouchSlider();
 </script>

+ 2 - 1
src/Masuit.MyBlogs.Core/Views/Shared/CaptchaChallenge.cshtml

@@ -15,11 +15,12 @@
     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
     <title>继续访问请输入验证码</title>
     <script src="https://cdn.staticfile.org/jquery/3.6.0/jquery.min.js"></script>
+    <script src="~/Scripts/layer/layer.js"></script>
     <script src="/Scripts/global/functions.js"></script>
 </head>
 <body>
     <h3>继续访问请输入验证码:</h3>
-    <img src="/[email protected]()" onclick="this.src='/challenge-captcha.jpg?'+new Date" />
+    <img class="captcha" src="/[email protected]()" onclick="this.src='/challenge-captcha.jpg?'+new Date" />
     <form asp-action="CaptchaChallenge" asp-controller="Firewall" method="post">
         @Html.AntiForgeryToken()
         <input type="text" name="code" placeholder="验证码" required="" />

+ 3 - 1
src/Masuit.MyBlogs.Core/Views/Shared/CloudflareTurnstileChallenge.cshtml

@@ -16,6 +16,7 @@
     <link href="https://cdn.staticfile.org/twitter-bootstrap/3.4.1/css/bootstrap.min.css" rel="stylesheet">
     <script src="https://cdn.staticfile.org/jquery/3.6.0/jquery.min.js"></script>
     <script src="https://challenges.cloudflare.com/turnstile/v0/api.js" async defer></script>
+    <script src="~/Scripts/layer/layer.js"></script>
     <script src="/Scripts/global/functions.js"></script>
 </head>
 <body>
@@ -33,6 +34,7 @@
     <form asp-controller="Firewall" asp-action="CloudflareTurnstileHandler" method="post">
         @Html.AntiForgeryToken()
         <div class="cf-turnstile" data-sitekey="@CommonHelper.SystemSettings["TurnstileClientKey"]" data-theme="light"></div>
+        <p class="text-danger">若验证码未正常加载,请手动刷新页面或检查是否被您的浏览器扩展拦截了。</p>
         <button id="btn" class="btn btn-lg btn-primary" type="submit" style="display: none">点击进入网站</button>
     </form>
 @Html.Raw(CommonHelper.SystemSettings["Scripts"])
@@ -46,6 +48,6 @@
                 $("#btn").show();
                 $("form").submit();
             }
-        },2000);
+        },1500);
     });
 </script>

+ 2 - 2
src/Masuit.MyBlogs.Core/Views/Shared/_Aside.cshtml

@@ -69,12 +69,12 @@
     </section>
     @foreach (var ad in Model.SidebarAds)
     {
-        <section class="wow animated fadeIn" id="@SnowFlake.NewId">
+        <section class="wow animated fadeIn">
             <article class="panel panel-info">
                 <div class="panel-heading">
                     @ad.Title
                 </div>
-                <div class="panel-body" id="@Stopwatch.GetTimestamp()">
+                <div class="panel-body">
                     <a asp-controller="Advertisement" asp-action="Redirect" asp-route-id="@ad.Id" target="_blank" id="@Stopwatch.GetTimestamp()">
                         <img class="img img-responsive" src="@(ad.ThumbImgUrl+"?width=300&format=webp&quality=50")" alt="@ad.Title" title="@ad.Title" decoding="async"/>
                     </a>