Pārlūkot izejas kodu

一些设置项的自定义

懒得勤快 5 gadi atpakaļ
vecāks
revīzija
c46719e4aa

+ 1 - 0
src/Masuit.MyBlogs.Core/Controllers/ToolsController.cs

@@ -4,6 +4,7 @@ using Masuit.Tools.Core.Net;
 using Masuit.Tools.Models;
 using Microsoft.AspNetCore.Mvc;
 using Newtonsoft.Json;
+using System;
 using System.Net.Http;
 using System.Threading.Tasks;
 

+ 12 - 12
src/Masuit.MyBlogs.Core/Controllers/UploadController.cs

@@ -154,7 +154,7 @@ namespace Masuit.MyBlogs.Core.Controllers
                     }
                     else
                     {
-                        var path = Path.Combine(HostEnvironment.WebRootPath, "upload", "images", imgFile);
+                        var path = Path.Combine(HostEnvironment.WebRootPath, CommonHelper.SystemSettings.GetOrAdd("UploadPath", "upload").Trim('/', '\\'), "images", imgFile);
                         await SaveFile(file, path);
                         img.Attributes["src"].Value = path.Substring(HostEnvironment.WebRootPath.Length).Replace("\\", "/");
                     }
@@ -188,7 +188,7 @@ namespace Masuit.MyBlogs.Core.Controllers
         public ActionResult Download(string path)
         {
             if (string.IsNullOrEmpty(path)) return Content("null");
-            var file = Path.Combine(HostEnvironment.WebRootPath + "/upload", path.Trim('.', '/', '\\'));
+            var file = Path.Combine(HostEnvironment.WebRootPath, CommonHelper.SystemSettings.GetOrAdd("UploadPath", "upload").Trim('/', '\\'), path.Trim('.', '/', '\\'));
             if (System.IO.File.Exists(file))
             {
                 return this.ResumePhysicalFile(file, Path.GetFileName(file));
@@ -211,7 +211,7 @@ namespace Masuit.MyBlogs.Core.Controllers
                 "uploadimage" => new UploadHandler(HttpContext, new UploadConfig()
                 {
                     AllowExtensions = UeditorConfig.GetStringList("imageAllowFiles"),
-                    PathFormat = UeditorConfig.GetString("imagePathFormat"),
+                    PathFormat = "/" + CommonHelper.SystemSettings.GetOrAdd("UploadPath", "upload").Trim('/', '\\') + UeditorConfig.GetString("imagePathFormat"),
                     SizeLimit = UeditorConfig.GetInt("imageMaxSize"),
                     UploadFieldName = UeditorConfig.GetString("imageFieldName")
                 }),
@@ -221,7 +221,7 @@ namespace Masuit.MyBlogs.Core.Controllers
                     {
                         ".png"
                     },
-                    PathFormat = UeditorConfig.GetString("scrawlPathFormat"),
+                    PathFormat = "/" + CommonHelper.SystemSettings.GetOrAdd("UploadPath", "upload").Trim('/', '\\') + UeditorConfig.GetString("scrawlPathFormat"),
                     SizeLimit = UeditorConfig.GetInt("scrawlMaxSize"),
                     UploadFieldName = UeditorConfig.GetString("scrawlFieldName"),
                     Base64 = true,
@@ -239,7 +239,7 @@ namespace Masuit.MyBlogs.Core.Controllers
                     //    action = new UploadHandler(context, new UploadConfig()
                     //    {
                     //        AllowExtensions = UeditorConfig.GetStringList("videoAllowFiles"),
-                    //        PathFormat = UeditorConfig.GetString("videoPathFormat"),
+                    //        PathFormat =  "/" + CommonHelper.SystemSettings.GetOrAdd("UploadPath", "upload") + UeditorConfig.GetString("videoPathFormat"),
                     //        SizeLimit = UeditorConfig.GetInt("videoMaxSize"),
                     //        UploadFieldName = UeditorConfig.GetString("videoFieldName")
                     //    });
@@ -248,16 +248,16 @@ namespace Masuit.MyBlogs.Core.Controllers
                         action = new UploadHandler(HttpContext, new UploadConfig()
                         {
                             AllowExtensions = UeditorConfig.GetStringList("fileAllowFiles"),
-                            PathFormat = UeditorConfig.GetString("filePathFormat"),
+                            PathFormat = "/" + CommonHelper.SystemSettings.GetOrAdd("UploadPath", "upload").Trim('/', '\\') + UeditorConfig.GetString("filePathFormat"),
                             SizeLimit = UeditorConfig.GetInt("fileMaxSize"),
                             UploadFieldName = UeditorConfig.GetString("fileFieldName")
                         });
                         break;
                         //case "listimage":
-                        //    action = new ListFileManager(context, UeditorConfig.GetString("imageManagerListPath"), UeditorConfig.GetStringList("imageManagerAllowFiles"));
+                        //    action = new ListFileManager(context, CommonHelper.SystemSettings.GetOrAdd("UploadPath", "/upload") + UeditorConfig.GetString("imageManagerListPath"), UeditorConfig.GetStringList("imageManagerAllowFiles"));
                         //    break;
                         //case "listfile":
-                        //    action = new ListFileManager(context, UeditorConfig.GetString("fileManagerListPath"), UeditorConfig.GetStringList("fileManagerAllowFiles"));
+                        //    action = new ListFileManager(context, CommonHelper.SystemSettings.GetOrAdd("UploadPath", "/upload") + UeditorConfig.GetString("fileManagerListPath"), UeditorConfig.GetStringList("fileManagerAllowFiles"));
                         //    break;
                 }
             }
@@ -286,7 +286,7 @@ namespace Masuit.MyBlogs.Core.Controllers
                             return ResultData(url);
                         }
 
-                        path = Path.Combine(HostEnvironment.WebRootPath, "upload", "images", filename);
+                        path = Path.Combine(HostEnvironment.WebRootPath, CommonHelper.SystemSettings.GetOrAdd("UploadPath", "upload").Trim('/', '\\'), "images", filename);
                         var dir = Path.GetDirectoryName(path);
                         if (!Directory.Exists(dir))
                         {
@@ -298,13 +298,13 @@ namespace Masuit.MyBlogs.Core.Controllers
                         break;
                     }
                 case var _ when file.ContentType.StartsWith("audio") || file.ContentType.StartsWith("video"):
-                    path = Path.Combine(HostEnvironment.WebRootPath, "upload", "media", filename);
+                    path = Path.Combine(HostEnvironment.WebRootPath, CommonHelper.SystemSettings.GetOrAdd("UploadPath", "upload").Trim('/', '\\'), "media", filename);
                     break;
                 case var _ when file.ContentType.StartsWith("text") || (ContentType.Doc + "," + ContentType.Xls + "," + ContentType.Ppt + "," + ContentType.Pdf).Contains(file.ContentType):
-                    path = Path.Combine(HostEnvironment.WebRootPath, "upload", "docs", filename);
+                    path = Path.Combine(HostEnvironment.WebRootPath, CommonHelper.SystemSettings.GetOrAdd("UploadPath", "upload").Trim('/', '\\'), "docs", filename);
                     break;
                 default:
-                    path = Path.Combine(HostEnvironment.WebRootPath, "upload", "files", filename);
+                    path = Path.Combine(HostEnvironment.WebRootPath, CommonHelper.SystemSettings.GetOrAdd("UploadPath", "upload").Trim('/', '\\'), "files", filename);
                     break;
             }
             try

+ 3 - 3
src/Masuit.MyBlogs.Core/Extensions/UEditor/CrawlerHandler.cs

@@ -87,7 +87,7 @@ namespace Masuit.MyBlogs.Core.Extensions.UEditor
                     return this;
                 }
 
-                ServerUrl = PathFormatter.Format(Path.GetFileName(SourceUrl), UeditorConfig.GetString("catcherPathFormat"));
+                ServerUrl = PathFormatter.Format(Path.GetFileName(SourceUrl), CommonHelper.SystemSettings.GetOrAdd("UploadPath", "upload").Trim('/', '\\') + UeditorConfig.GetString("catcherPathFormat"));
                 var stream = response.Content.ReadAsStreamAsync().Result;
                 var savePath = AppContext.BaseDirectory + "wwwroot" + ServerUrl;
                 stream = stream.AddWatermark();
@@ -104,8 +104,8 @@ namespace Masuit.MyBlogs.Core.Extensions.UEditor
                     }
 
                     var ms = new MemoryStream();
-                    stream.CopyTo(ms);
-                    File.WriteAllBytes(savePath, ms.GetBuffer());
+                    await stream.CopyToAsync(ms);
+                    await File.WriteAllBytesAsync(savePath, ms.GetBuffer());
                 }
                 stream.Close();
                 await stream.DisposeAsync();

+ 1 - 58
src/Masuit.MyBlogs.Core/Views/Misc/Donate.cshtml

@@ -52,64 +52,7 @@
         </p>
     </div>
 </div>
-<div class="container">
-    <p class="text-red size20">
-        如果你现在正好需要一台显示器,可以到我的<a href="https://shop123472283.taobao.com/" target="_blank">淘宝店铺</a>进行选购以表支持本站发展。
-    </p>
-    <p class="text-red size20">
-        或者可以点击本站任意形式的广告链接,购买正版软件或服务以表示对本站的支持!
-    </p>
-</div>
-<div class="container-fluid">
-    <div class="row">
-        <div class="col-md-4">
-            <div class="page-header margin-clear margin-top10">
-                <h2 class="size28">
-                    支付宝二维码
-                </h2>
-            </div>
-            <img class="img-responsive img-thumbnail" style="width: 100%" src="@CommonHelper.SystemSettings["Donate"]" />
-        </div>
-        <div class="col-md-4">
-            <div class="page-header margin-clear margin-top10">
-                <h2 class="size28">
-                    微信二维码
-                </h2>
-            </div>
-            <img class="img-responsive img-thumbnail" style="width: 100%" src="@CommonHelper.SystemSettings["DonateWechat"]" />
-            <div class="protected">
-                <span class="text-red size20">注意:支付宝和微信无法看见支付人的名称,所以打赏时最好附上完整个人信息,否则无法将您加入到赞助名单中。</span>
-            </div>
-        </div>
-        <div class="col-md-4">
-            <div class="page-header margin-clear margin-top10">
-                <h2 class="size28">
-                    QQ二维码
-                </h2>
-            </div>
-            <img class="img-responsive img-thumbnail" style="width: 100%" src="@CommonHelper.SystemSettings["DonateQQ"]" />
-        </div>
-    </div>
-</div>
-<div class="container margintop20">
-    <div class="text-green size20" style="line-height: 26px;">
-        <p>
-            本网站由博主一个人打造,开发和运营均为博主本人,如果您是真心喜欢本博客,您可以对博主表示一下感谢,以支持后期发布更多好资源,5毛也好、1元也罢,都是你们的心意。网站运营也需要成本,有你的援助,一切会更好。
-        </p>
-        <p class="text-red size20">
-            打赏时最好能够附上你的完整信息,包括:您的昵称或真名、邮箱地址、QQ或微信、金额等;因为不能保证能够完全的清楚打赏者的基本信息,如果你完成了打赏,推荐你在网站留言板备注一下,或者QQ私信告知你是谁。
-        </p>
-        <p>
-            您可以尽您所能地打赏,如果您临时改变主意,您可以在事后一个月之内联系作者申请退款!
-        </p>
-        <p>
-            本站的宗旨是:互联网分享精神,乐于发现,勤于分享;
-        </p>
-        <p>
-            我希望的:您将我的网站告诉你的朋友,让更多的人来这里学习,共同进步。
-        </p>
-    </div>
-</div>
[email protected](CommonHelper.SystemSettings.GetOrAdd("DonateHtml", ""))
 <div class="container-fluid" ng-app="myApp" ng-controller="home as list">
     <div class="page-header margin-clear">
         <h2 class="size24">

+ 1 - 55
src/Masuit.MyBlogs.Core/Views/Misc/Donate_Admin.cshtml

@@ -57,61 +57,7 @@
         </p>
     </div>
 </div>
-<div class="container">
-    <p class="text-red size20">
-        如果你现在正好需要一台显示器,可以到我的<a href="https://shop123472283.taobao.com/" target="_blank">淘宝店铺</a>进行选购以表支持本站发展。
-    </p>
-    <p class="text-red size20">
-        或者可以点击本站任意形式的广告链接,购买正版软件或服务以表示对本站的支持!
-    </p>
-</div>
-<div class="container-fluid">
-    <div class="flex-box">
-        <div>
-            <div class="page-header margin-clear margin-top10">
-                <h2 class="size28">
-                    支付宝二维码
-                </h2>
-            </div>
-            <img class="img-responsive img-thumbnail" style="width: 100%" src="@CommonHelper.SystemSettings["Donate"]" />
-        </div>
-        <div>
-            <div class="page-header margin-clear margin-top10">
-                <h2 class="size28">
-                    微信二维码
-                </h2>
-            </div>
-            <img class="img-responsive img-thumbnail" style="width: 100%" src="@CommonHelper.SystemSettings["DonateWechat"]" />
-        </div>
-        <div>
-            <div class="page-header margin-clear margin-top10">
-                <h2 class="size28">
-                    QQ二维码
-                </h2>
-            </div>
-            <img class="img-responsive img-thumbnail" style="width: 100%" src="@CommonHelper.SystemSettings["DonateQQ"]" />
-        </div>
-    </div>
-</div>
-<div class="container margintop20">
-    <div class="text-green size20" style="line-height: 26px;">
-        <p>
-            本网站由博主一个人打造,开发和运营均为博主本人,如果您是真心喜欢本博客,您可以对博主表示一下感谢,以支持后期发布更多好资源,5毛也好、1元也罢,都是你们的心意。网站运营也需要成本,有你的援助,一切会更好。
-        </p>
-        <p class="text-red size20">
-            打赏时最好能够附上你的完整信息,包括:您的昵称或真名、邮箱地址、QQ或微信、金额等;因为不能保证能够完全的清楚打赏者的基本信息,如果你完成了打赏,推荐你在网站留言板备注一下,或者QQ私信告知你是谁。
-        </p>
-        <p>
-            您可以尽您所能地打赏,如果您临时改变主意,您可以在事后一个月之内联系作者申请退款!
-        </p>
-        <p>
-            本站的宗旨是:互联网分享精神,乐于发现,勤于分享;
-        </p>
-        <p>
-            我希望的:您将我的网站告诉你的朋友,让更多的人来这里学习,共同进步。
-        </p>
-    </div>
-</div>
[email protected](CommonHelper.SystemSettings.GetOrAdd("DonateHtml", ""))
 <div class="container-fluid" ng-app="myApp" ng-controller="home as list">
     <div class="page-header margin-clear">
         <h2 class="size24" style="display: inline">

+ 13 - 15
src/Masuit.MyBlogs.Core/Views/Post/Details.cshtml

@@ -61,19 +61,19 @@
                                 @{
                                     if (!string.IsNullOrEmpty(Model.Label))
                                     {
-                                    <div class="pull-right margin-right20">
-                                        <div>
-                                            @foreach (string s in Model.Label.Split(',', ','))
+                                        <div class="pull-right margin-right20">
+                                            <div>
+                                                @foreach (string s in Model.Label.Split(',', ','))
                                                 {
                                                     if (!string.IsNullOrEmpty(s))
                                                     {
-                                            <a asp-controller="Home" asp-action="Tag" asp-route-id="@s">
-                                                <span class="label label-@colors[new Random().Next() % colors.Length]">@s</span>
-                                            </a>
+                                                        <a asp-controller="Home" asp-action="Tag" asp-route-id="@s">
+                                                            <span class="label label-@colors[new Random().Next() % colors.Length]">@s</span>
+                                                        </a>
                                                     }
                                                 }
+                                            </div>
                                         </div>
-                                    </div>
                                     }
                                 }
                             </div>
@@ -82,12 +82,12 @@
                                     分类:<i class="icon-map-pin"></i><a asp-controller="Home" asp-action="Category" asp-route-id="@Model.CategoryId" class="label label-@colors[new Random().Next() % colors.Length]">@Model.Category.Name</a> | 评论总数:<span class="text-danger">@Model.Comment.Count</span>条 | 热度:<span class="text-danger">@Model.TotalViewCount</span>℃
                                     @if (Model.Seminar.Any())
                                     {
-                                    <span> | 所属专题:</span>
+                                        <span> | 所属专题:</span>
                                         var seminars = Model.Seminar;
                                         foreach (var s in seminars)
                                         {
-                                    <a asp-controller="Seminar" asp-action="Index" asp-route-id="@s.SeminarId" class="label label-@colors[new Random().Next() % colors.Length]">@s.Seminar.Title</a>
-                                    <text> </text>
+                                            <a asp-controller="Seminar" asp-action="Index" asp-route-id="@s.SeminarId" class="label label-@colors[new Random().Next() % colors.Length]">@s.Seminar.Title</a>
+                                            <text> </text>
                                         }
                                     }
                                     <div class="pull-right margin-right20">
@@ -95,8 +95,9 @@
                                     </div>
                                 </div>
                             </div>
-                            @if(DateTime.Now-Model.ModifyDate>TimeSpan.FromDays(365)) {
-                            <p class="text-focus text-center">该文章已经超过1年未更新,可能无法为您提供及时准确的资讯,请根据当下实际情况,酌情参考本文内容。</p>
+                            @if (DateTime.Now - Model.ModifyDate > TimeSpan.FromDays(365))
+                            {
+                                <p class="text-focus text-center">该文章已经超过1年未更新,可能无法为您提供及时准确的资讯,请根据当下实际情况,酌情参考本文内容。</p>
                             }
                         </header>
                         <article class="article" id="article">
@@ -188,9 +189,6 @@
                             <a class="btn btn-danger btn-lg" asp-controller="Subscribe" asp-action="PostRss" asp-route-id="@Model.Id" target="_blank">
                                 <i class="icon-rss4"></i><span>订阅本文更新</span>
                             </a>
-                            <button type="button" id="donate" class="btn btn-info btn-lg">
-                                <i class="icon-coin-yen"></i><span>支持站长</span>
-                            </button>
                         </div>
                     </div>
                 </section>

+ 15 - 21
src/Masuit.MyBlogs.Core/Views/Post/Details_Admin.cshtml

@@ -63,19 +63,19 @@
                                 @{
                                     if (!string.IsNullOrEmpty(Model.Label))
                                     {
-                                    <div class="pull-right margin-right20">
-                                        <div>
-                                            @foreach (string s in Model.Label.Split(',', ','))
+                                        <div class="pull-right margin-right20">
+                                            <div>
+                                                @foreach (string s in Model.Label.Split(',', ','))
                                                 {
                                                     if (!string.IsNullOrEmpty(s))
                                                     {
-                                            <a asp-controller="Home" asp-action="Tag" asp-route-id="@s">
-                                                <span class="label label-@colors[new Random().Next() % colors.Length]">@s</span>
-                                            </a>
+                                                        <a asp-controller="Home" asp-action="Tag" asp-route-id="@s">
+                                                            <span class="label label-@colors[new Random().Next() % colors.Length]">@s</span>
+                                                        </a>
                                                     }
                                                 }
+                                            </div>
                                         </div>
-                                    </div>
                                     }
                                 }
                             </div>
@@ -84,11 +84,11 @@
                                     分类:<i class="icon-map-pin"></i><a asp-controller="Home" asp-action="Category" asp-route-id="@Model.CategoryId" class="label label-@colors[new Random().Next() % colors.Length]">@Model.Category.Name</a>  | 评论总数:<span class="text-danger">@Model.Comment.Count</span>条 | 热度:<span class="text-danger">@Model.TotalViewCount</span>℃ | 状态:@Model.Status.GetDisplay()
                                     @if (Model.Seminar.Any())
                                     {
-                                    <span> | 所属专题:</span>
+                                        <span> | 所属专题:</span>
                                         var seminars = Model.Seminar;
                                         foreach (var s in seminars)
                                         {
-                                    <a asp-controller="Seminar" asp-action="Index" asp-route-id="@s.SeminarId" class="label label-@colors[new Random().Next() % colors.Length]">@s.Seminar.Title</a><text> </text>
+                                            <a asp-controller="Seminar" asp-action="Index" asp-route-id="@s.SeminarId" class="label label-@colors[new Random().Next() % colors.Length]">@s.Seminar.Title</a><text> </text>
                                         }
                                     }
                                     <div class="pull-right margin-right20">
@@ -96,15 +96,15 @@
                                             <a asp-controller="Post" asp-action="Refresh" asp-route-id="@Model.Id" class="btn btn-info">刷新</a>
                                             @if (Model.IsFixedTop)
                                             {
-                                            <button class="btn btn-success" id="pin">取消置顶</button>
+                                                <button class="btn btn-success" id="pin">取消置顶</button>
                                             }
                                             else
                                             {
-                                            <button class="btn btn-success" id="pin">置顶</button>
+                                                <button class="btn btn-success" id="pin">置顶</button>
                                             }
                                             @if (Model.Status == Status.Pending)
                                             {
-                                            <button class="btn btn-primary" id="pass">通过</button>
+                                                <button class="btn btn-primary" id="pass">通过</button>
                                             }
                                             <a asp-controller="Dashboard" asp-action="Index" asp-fragment="/post/[email protected]" class="btn btn-primary" target="_blank">修改</a>
                                             <button class="btn btn-danger" id="del">删除</button>
@@ -112,8 +112,9 @@
                                     </div>
                                 </div>
                             </div>
-                            @if(DateTime.Now-Model.ModifyDate>TimeSpan.FromDays(365)) {
-                            <p class="text-focus text-center">该文章已经超过1年未更新,可能无法为您提供及时准确的资讯,请根据当下实际情况,酌情参考本文内容。</p>
+                            @if (DateTime.Now - Model.ModifyDate > TimeSpan.FromDays(365))
+                            {
+                                <p class="text-focus text-center">该文章已经超过1年未更新,可能无法为您提供及时准确的资讯,请根据当下实际情况,酌情参考本文内容。</p>
                             }
                         </header>
                         <article class="article" id="article">
@@ -169,13 +170,6 @@
                             </button>
                         </div>
                     </div>
-                    <div class="col-xs-6 text-right">
-                        <div class="btn-group">
-                            <button type="button" id="donate" class="btn btn-@colors[new Random().Next() % colors.Length] btn-lg">
-                                <i class="icon-coin-yen"></i><span>支持站长</span>
-                            </button>
-                        </div>
-                    </div>
                 </section>
                 <section class="wow row size16 animated fadeIn">
                     <div class="col-xs-6">

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

@@ -178,15 +178,4 @@
             </div>
         </article>
     </section>
-
-    <section class="wow animated fadeIn">
-        <article class="panel panel-primary">
-            <div class="panel-heading">
-                <i class="icon-coin-yen"></i>支付宝支持本站 <a asp-controller="Misc" asp-action="Donate" class="pull-right text-white">更多方式</a>
-            </div>
-            <div class="panel-body">
-                <img class="img img-responsive img-thumbnail" src="@CommonHelper.SystemSettings["Donate"]" alt="@CommonHelper.SystemSettings["Title"]" title="@CommonHelper.SystemSettings["Title"]" />
-            </div>
-        </article>
-    </section>
 </aside>

+ 8 - 8
src/Masuit.MyBlogs.Core/ueconfig.json

@@ -9,7 +9,7 @@
     "imageCompressBorder": 1600, /* 图片压缩最长边限制 */
     "imageInsertAlign": "none", /* 插入的图片浮动方式 */
     "imageUrlPrefix": "", /* 图片访问路径前缀 */
-    "imagePathFormat": "/upload/images/{yyyy}{mm}{dd}/{time}{rand:6}", /* 上传保存路径,可以自定义保存路径和文件名格式 */
+    "imagePathFormat": "/images/{yyyy}{mm}{dd}/{time}{rand:6}", /* 上传保存路径,可以自定义保存路径和文件名格式 */
     /* {filename} 会替换成原文件名,配置这项需要注意中文乱码问题 */
     /* {rand:6} 会替换成随机数,后面的数字是随机数的位数 */
     /* {time} 会替换成时间戳 */
@@ -26,14 +26,14 @@
     /* 涂鸦图片上传配置项 */
     "scrawlActionName": "uploadscrawl", /* 执行上传涂鸦的action名称 */
     "scrawlFieldName": "upfile", /* 提交的图片表单名称 */
-    "scrawlPathFormat": "/upload/images/{yyyy}{mm}{dd}/{time}{rand:6}", /* 上传保存路径,可以自定义保存路径和文件名格式 */
+    "scrawlPathFormat": "/images/{yyyy}{mm}{dd}/{time}{rand:6}", /* 上传保存路径,可以自定义保存路径和文件名格式 */
     "scrawlMaxSize": 20480000, /* 上传大小限制,单位B */
     "scrawlUrlPrefix": "", /* 图片访问路径前缀 */
     "scrawlInsertAlign": "none",
 
     /* 截图工具上传 */
     "snapscreenActionName": "uploadimage", /* 执行上传截图的action名称 */
-    "snapscreenPathFormat": "/upload/images/{yyyy}{mm}{dd}/{time}{rand:6}", /* 上传保存路径,可以自定义保存路径和文件名格式 */
+    "snapscreenPathFormat": "/images/{yyyy}{mm}{dd}/{time}{rand:6}", /* 上传保存路径,可以自定义保存路径和文件名格式 */
     "snapscreenUrlPrefix": "", /* 图片访问路径前缀 */
     "snapscreenInsertAlign": "none", /* 插入的图片浮动方式 */
 
@@ -61,7 +61,7 @@
     ],
     "catcherActionName": "catchimage", /* 执行抓取远程图片的action名称 */
     "catcherFieldName": "source", /* 提交的图片列表表单名称 */
-    "catcherPathFormat": "/upload/images/{yyyy}{mm}{dd}/{time}{rand:6}", /* 上传保存路径,可以自定义保存路径和文件名格式 */
+    "catcherPathFormat": "/images/{yyyy}{mm}{dd}/{time}{rand:6}", /* 上传保存路径,可以自定义保存路径和文件名格式 */
     "catcherUrlPrefix": "", /* 图片访问路径前缀 */
     "catcherMaxSize": 20480000, /* 上传大小限制,单位B */
     "catcherAllowFiles": [ ".png", ".jpg", ".jpeg", ".gif", ".bmp" ], /* 抓取图片格式显示 */
@@ -69,7 +69,7 @@
     /* 上传视频配置 */
     "videoActionName": "uploadvideo", /* 执行上传视频的action名称 */
     "videoFieldName": "upfile", /* 提交的视频表单名称 */
-    "videoPathFormat": "upload/video/{yyyy}{mm}{dd}/{time}{rand:6}", /* 上传保存路径,可以自定义保存路径和文件名格式 */
+    "videoPathFormat": "/video/{yyyy}{mm}{dd}/{time}{rand:6}", /* 上传保存路径,可以自定义保存路径和文件名格式 */
     "videoUrlPrefix": "", /* 视频访问路径前缀 */
     "videoMaxSize": 2147483647, /* 上传大小限制,单位B,默认100MB */
     "videoAllowFiles": [
@@ -96,7 +96,7 @@
     /* 上传文件配置 */
     "fileActionName": "uploadfile", /* controller里,执行上传视频的action名称 */
     "fileFieldName": "upfile", /* 提交的文件表单名称 */
-    "filePathFormat": "upload/file/{yyyy}{mm}{dd}/{time}{rand:6}", /* 上传保存路径,可以自定义保存路径和文件名格式 */
+    "filePathFormat": "/file/{yyyy}{mm}{dd}/{time}{rand:6}", /* 上传保存路径,可以自定义保存路径和文件名格式 */
     "fileUrlPrefix": "", /* 文件访问路径前缀 */
     "fileMaxSize": 2147483647, /* 上传大小限制,单位B,默认50MB */
     "fileAllowFiles": [
@@ -144,7 +144,7 @@
 
     /* 列出指定目录下的图片 */
     "imageManagerActionName": "listimage", /* 执行图片管理的action名称 */
-    "imageManagerListPath": "/upload/images", /* 指定要列出图片的目录 */
+    "imageManagerListPath": "/images", /* 指定要列出图片的目录 */
     "imageManagerListSize": 20, /* 每次列出文件数量 */
     "imageManagerUrlPrefix": "", /* 图片访问路径前缀 */
     "imageManagerInsertAlign": "none", /* 插入的图片浮动方式 */
@@ -152,7 +152,7 @@
 
     /* 列出指定目录下的文件 */
     "fileManagerActionName": "listfile", /* 执行文件管理的action名称 */
-    "fileManagerListPath": "upload/file", /* 指定要列出文件的目录 */
+    "fileManagerListPath": "/file", /* 指定要列出文件的目录 */
     "fileManagerUrlPrefix": "", /* 文件访问路径前缀 */
     "fileManagerListSize": 20, /* 每次列出文件数量 */
     "fileManagerAllowFiles": [

+ 5 - 9
src/Masuit.MyBlogs.Core/wwwroot/Assets/UEditor/ueditor.config.admin.js

@@ -436,21 +436,17 @@
 
         //默认过滤规则相关配置项目
         //,disabledTableInTable:true  //禁止表格嵌套
-        //,allowDivTransToP:true      //允许进入编辑器的div标签自动变成p标签
+        ,allowDivTransToP:false      //允许进入编辑器的div标签自动变成p标签
         //,rgb2Hex:true               //默认产出的数据中的color自动从rgb格式变成16进制格式
 
         // xss 过滤是否开启,inserthtml等操作
-        ,
-        xssFilterRules: false
+        , xssFilterRules: false
         //input xss过滤
-        ,
-        inputXssFilter: false
+        , inputXssFilter: false
         //output xss过滤
-        ,
-        outputXssFilter: false
+        , outputXssFilter: false
         // xss过滤白名单 名单来源: https://raw.githubusercontent.com/leizongmin/js-xss/master/lib/default.js
-        ,
-        whitList: {
+        , whitList: {
             a: ['target', 'href', 'title', 'class', 'style'],
             abbr: ['title', 'class', 'style'],
             address: ['class', 'style'],

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
src/Masuit.MyBlogs.Core/wwwroot/Assets/UEditor/ueditor.config.admin.min.js


+ 1 - 1
src/Masuit.MyBlogs.Core/wwwroot/Assets/UEditor/ueditor.config.front.js

@@ -434,7 +434,7 @@
 
         //默认过滤规则相关配置项目
         //,disabledTableInTable:true  //禁止表格嵌套
-        //,allowDivTransToP:true      //允许进入编辑器的div标签自动变成p标签
+        ,allowDivTransToP:false      //允许进入编辑器的div标签自动变成p标签
         //,rgb2Hex:true               //默认产出的数据中的color自动从rgb格式变成16进制格式
 
         // xss 过滤是否开启,inserthtml等操作

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
src/Masuit.MyBlogs.Core/wwwroot/Assets/UEditor/ueditor.config.front.min.js


+ 0 - 28
src/Masuit.MyBlogs.Core/wwwroot/Scripts/global/article.js

@@ -198,34 +198,6 @@
 			});
         });
 	});
-
-	$("#donate").on("click", function (e) {
-		window.post("/system/getsetting", { name: "Donate" }, function (data) {
-			swal({
-				title: "支付宝扫一扫付款打赏!",
-				html:"<a href='/donate'>更多方式</a>",
-				showCancelButton: true,
-				confirmButtonColor: "#DD6B55",
-				confirmButtonText: "确定",
-				cancelButtonText: "取消",
-				showLoaderOnConfirm: true,
-				imageUrl: data.Data.Value,
-				imageWidth: 400,
-				animation: true,
-				allowOutsideClick: false
-			}).then(function() {
-
-			}, function() {
-				swal("您的打赏将会支持本站做的更好!", null, "error");
-			});
-		}, function() {
-            window.notie.alert({
-				type: 3,
-				text: "请求失败,请稍候再试!",
-				time: 4
-			});
-        });
-	});
 });
 
 /**

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
src/Masuit.MyBlogs.Core/wwwroot/Scripts/global/article.min.js


+ 8 - 22
src/Masuit.MyBlogs.Core/wwwroot/ng-views/views/system/home.html

@@ -64,6 +64,12 @@
                 <button type="button" class="btn btn-info" ng-click="pathtest()">检查路径</button>
             </span>
         </div>
+        <div class="input-group">
+            <span class="input-group-addon">文件上传目录:</span>
+            <div class="fg-line">
+                <input type="text" class="form-control" ng-model="Settings.UploadPath" placeholder="/upload" />
+            </div>
+        </div>
     </div>
     <div class="row">
         <h3>自定义脚本和样式</h3>
@@ -164,28 +170,8 @@
         </div>
     </div>
     <div class="row">
-        <h2>打赏二维码</h2>
-        <div class="col-md-2 col-xs-6">
-            <h3>支付宝:</h3>
-            <img class="img img-responsive img-thumbnail img-rounded" ng-src="{{Settings.Donate}}" style="max-height: 300px;" ng-click="setImage('Donate')" />
-            <span class="input-group-btn">
-                <button type="button" class="btn btn-danger waves-effect" ng-click="setImage('Donate')">修改</button>
-            </span>
-        </div>
-        <div class="col-md-2 col-xs-6">
-            <h3>微信:</h3>
-            <img class="img img-responsive img-thumbnail img-rounded" ng-src="{{Settings.DonateWechat}}" style="max-height: 300px;" ng-click="setImage('DonateWechat')" />
-            <span class="input-group-btn">
-                <button type="button" class="btn btn-danger waves-effect" ng-click="setImage('DonateWechat')">修改</button>
-            </span>
-        </div>
-        <div class="col-md-2 col-xs-6">
-            <h3>QQ:</h3>
-            <img class="img img-responsive img-thumbnail img-rounded" ng-src="{{Settings.DonateQQ}}" style="max-height: 300px;" ng-click="setImage('DonateQQ')" />
-            <span class="input-group-btn">
-                <button type="button" class="btn btn-danger waves-effect" ng-click="setImage('DonateQQ')">修改</button>
-            </span>
-        </div>
+        <h2>打赏页</h2>
+        <div style="height: 300px;" class="ueditor" ng-model="Settings.DonateHtml" type="text/plain"></div>
     </div>
 </div>
 <div style="position: absolute;left: -20000px">

Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels