懒得勤快 3 anni fa
parent
commit
6a5da2da32

+ 6 - 0
src/Masuit.MyBlogs.Core.sln

@@ -11,6 +11,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masuit.MyBlogs.Core", "Masu
 EndProject
 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masuit.Tools.AspNetCore", "..\..\Masuit.Tools\Masuit.Tools.AspNetCore\Masuit.Tools.AspNetCore.csproj", "{F67A19C8-5ACE-4111-8DB5-51A0159AF5A3}"
 EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masuit.Tools.Abstractions", "..\..\Masuit.Tools\Masuit.Tools.Abstractions\Masuit.Tools.Abstractions.csproj", "{0661EDB7-12E8-4F8B-AD0B-1CDEF7D03FAD}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
@@ -33,6 +35,10 @@ Global
 		{F67A19C8-5ACE-4111-8DB5-51A0159AF5A3}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{F67A19C8-5ACE-4111-8DB5-51A0159AF5A3}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{F67A19C8-5ACE-4111-8DB5-51A0159AF5A3}.Release|Any CPU.Build.0 = Release|Any CPU
+		{0661EDB7-12E8-4F8B-AD0B-1CDEF7D03FAD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{0661EDB7-12E8-4F8B-AD0B-1CDEF7D03FAD}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{0661EDB7-12E8-4F8B-AD0B-1CDEF7D03FAD}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{0661EDB7-12E8-4F8B-AD0B-1CDEF7D03FAD}.Release|Any CPU.Build.0 = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE

+ 1 - 2
src/Masuit.MyBlogs.Core/Controllers/AdvertisementController.cs

@@ -11,7 +11,6 @@ using Masuit.Tools.AspNetCore.Mime;
 using Masuit.Tools.AspNetCore.ModelBinder;
 using Masuit.Tools.AspNetCore.ResumeFileResults.Extensions;
 using Masuit.Tools.Core.Net;
-using Masuit.Tools.Database;
 using Masuit.Tools.Excel;
 using Masuit.Tools.Linq;
 using Masuit.Tools.Models;
@@ -189,7 +188,7 @@ public class AdvertisementController : BaseController
     public IActionResult ExportClickRecords(int id)
     {
         using var list = ClickRecordService.GetQuery<DateTime, AdvertisementClickRecordViewModel>(e => e.AdvertisementId == id, e => e.Time, false).ToPooledList();
-        using var ms = list.ToDataTable().ToExcel();
+        using var ms = list.ToExcel();
         var advertisement = AdsService[id];
         return this.ResumeFile(ms.ToArray(), ContentType.Xlsx, advertisement.Title + "访问记录.xlsx");
     }

+ 10 - 2
src/Masuit.MyBlogs.Core/Controllers/PostController.cs

@@ -102,7 +102,15 @@ namespace Masuit.MyBlogs.Core.Controllers
             ViewBag.CommentsCount = CommentService.Count(c => c.PostId == id && c.ParentId == null && c.Status == Status.Published);
             ViewBag.HistoryCount = PostHistoryVersionService.Count(c => c.PostId == id);
             ViewBag.Keyword = post.Keyword + "," + post.Label;
-            ViewBag.Desc = "若页面无法访问,可通过搜索引擎网页快照进行浏览。" + await post.Content.GetSummary(200);
+            if (Request.Query.ContainsKey("share"))
+            {
+                ViewBag.Desc = await post.Content.GetSummary(200);
+            }
+            else
+            {
+                ViewBag.Desc = "若页面无法访问,可通过搜索引擎网页快照进行浏览。" + await post.Content.GetSummary(200);
+            }
+
             var modifyDate = post.ModifyDate;
             ViewBag.Next = await PostService.GetFromCacheAsync<DateTime, PostModelBase>(p => p.ModifyDate > modifyDate && (p.LimitMode ?? 0) == RegionLimitMode.All && (p.Status == Status.Published || CurrentUser.IsAdmin), p => p.ModifyDate);
             ViewBag.Prev = await PostService.GetFromCacheAsync<DateTime, PostModelBase>(p => p.ModifyDate < modifyDate && (p.LimitMode ?? 0) == RegionLimitMode.All && (p.Status == Status.Published || CurrentUser.IsAdmin), p => p.ModifyDate, false);
@@ -1159,7 +1167,7 @@ namespace Masuit.MyBlogs.Core.Controllers
         public IActionResult ExportPostVisitRecords(int id)
         {
             using var list = PostVisitRecordService.GetQuery<DateTime, PostVisitRecordViewModel>(e => e.PostId == id, e => e.Time, false).ToPooledList();
-            using var ms = list.ToDataTable().ToExcel();
+            using var ms = list.ToExcel();
             var post = PostService[id];
             return this.ResumeFile(ms.ToArray(), ContentType.Xlsx, post.Title + "访问记录.xlsx");
         }

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

@@ -53,7 +53,7 @@
         <PackageReference Include="htmldiff.net" Version="1.4.0" />
         <PackageReference Include="IP2Region" Version="1.2.0" />
         <PackageReference Include="Karambolo.AspNetCore.Bundling.NUglify" Version="3.5.1" />
-        <PackageReference Include="Masuit.Tools.Excel" Version="1.2.2" />
+        <PackageReference Include="Masuit.Tools.Excel" Version="1.2.3-beta5" />
         <PackageReference Include="MaxMind.GeoIP2" Version="5.1.0" />
         <PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="6.0.10" />
         <PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="6.0.10" />

+ 3 - 1
src/Masuit.MyBlogs.Core/wwwroot/ng-views/controllers/system.js

@@ -496,7 +496,9 @@ myApp.controller("firewall", ["$scope", "$http","NgTableParams","$timeout", func
 		  type: 1,
 		  area: ['600px', '80%'], //宽高
 		  content: text
-        });
+		});
+		$('.layui-layer-content').jsonViewer(eval("("+text+")"), {withQuotes: true, withLinks: true});
+		$('.layui-layer-content').css("word-wrap"," break-word");
 	}
 
 	$scope.distinct=false;