Parcourir la source

修正公告详情bug

懒得勤快 il y a 5 ans
Parent
commit
a788158efc

+ 2 - 2
src/Masuit.MyBlogs.Core/Controllers/NoticeController.cs

@@ -61,8 +61,6 @@ namespace Masuit.MyBlogs.Core.Controllers
         public async Task<ActionResult> Details(int id)
         {
             var notice = await NoticeService.GetByIdAsync(id) ?? throw new NotFoundException("页面未找到");
-            notice.ModifyDate = notice.ModifyDate.ToTimeZone(HttpContext.Session.Get<string>(SessionKey.TimeZone));
-            notice.PostDate = notice.PostDate.ToTimeZone(HttpContext.Session.Get<string>(SessionKey.TimeZone));
             if (!HttpContext.Session.TryGetValue("notice" + id, out _))
             {
                 notice.ViewCount += 1;
@@ -70,6 +68,8 @@ namespace Masuit.MyBlogs.Core.Controllers
                 HttpContext.Session.Set("notice" + id, notice.Title);
             }
 
+            notice.ModifyDate = notice.ModifyDate.ToTimeZone(HttpContext.Session.Get<string>(SessionKey.TimeZone));
+            notice.PostDate = notice.PostDate.ToTimeZone(HttpContext.Session.Get<string>(SessionKey.TimeZone));
             return View(notice);
         }
 

+ 3 - 3
src/Masuit.MyBlogs.Core/Masuit.MyBlogs.Core.csproj

@@ -31,13 +31,13 @@
 
     <ItemGroup>
         <PackageReference Include="Aliyun.OSS.SDK.NetCore" Version="2.11.0" />
-        <PackageReference Include="Autofac.Extensions.DependencyInjection" Version="7.0.1" />
+        <PackageReference Include="Autofac.Extensions.DependencyInjection" Version="7.0.2" />
         <PackageReference Include="AutoMapper.Extensions.ExpressionMapping" Version="4.0.1" />
         <PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="8.0.1" />
         <PackageReference Include="CacheManager.Microsoft.Extensions.Caching.Memory" Version="2.0.0-beta-1629" />
         <PackageReference Include="CacheManager.Serialization.Json" Version="2.0.0-beta-1629" />
         <PackageReference Include="CSRedisCore" Version="3.6.5" />
-        <PackageReference Include="Hangfire" Version="1.7.14" />
+        <PackageReference Include="Hangfire" Version="1.7.15" />
         <PackageReference Include="Hangfire.Autofac" Version="2.3.1" />
         <PackageReference Include="Hangfire.MemoryStorage" Version="1.7.0" />
         <PackageReference Include="htmldiff.net-core" Version="1.3.6" />
@@ -58,7 +58,7 @@
         <PackageReference Include="TimeZoneConverter" Version="3.3.0" />
         <PackageReference Include="WilderMinds.RssSyndication" Version="1.6.0" />
         <PackageReference Include="WinInsider.System.Net.Http.Formatting" Version="1.0.14" />
-        <PackageReference Include="Z.EntityFramework.Plus.EFCore" Version="3.0.63" />
+        <PackageReference Include="Z.EntityFramework.Plus.EFCore" Version="3.0.64" />
     </ItemGroup>
     <ItemGroup>
         <Content Update="appsettings.json">