懒得勤快 5 năm trước cách đây
mục cha
commit
e1bc84ca55

+ 0 - 1
src/Masuit.MyBlogs.Core/Configs/MappingProfile.cs

@@ -90,7 +90,6 @@ namespace Masuit.MyBlogs.Core.Configs
             CreateMap<AdvertisementDto, Advertisement>().ForMember(a => a.Status, e => e.Ignore()).ForMember(a => a.UpdateTime, e => e.MapFrom(a => DateTime.Now));
 
             CreateMap<Donate, DonateDto>();
-            CreateMap<Donate, DonateDtoBase>();
         }
     }
 }

+ 9 - 1
src/Masuit.MyBlogs.Core/Controllers/MiscController.cs

@@ -65,7 +65,15 @@ namespace Masuit.MyBlogs.Core.Controllers
         [Route("donatelist")]
         public ActionResult DonateList(int page = 1, int size = 10)
         {
-            var list = DonateService.GetPagesFromCache<DateTime, DonateDtoBase>(page, size, d => true, d => d.DonateTime, false);
+            var list = DonateService.GetPagesFromCache<DateTime, DonateDto>(page, size, d => true, d => d.DonateTime, false);
+            if (!CurrentUser.IsAdmin)
+            {
+                foreach (var item in list.Data)
+                {
+                    item.QQorWechat = item.QQorWechat.Mask();
+                    item.Email = item.Email.MaskEmail();
+                }
+            }
             return Ok(list);
         }
 

+ 23 - 3
src/Masuit.MyBlogs.Core/Models/DTO/DonateDto.cs

@@ -1,10 +1,31 @@
-namespace Masuit.MyBlogs.Core.Models.DTO
+using System;
+
+namespace Masuit.MyBlogs.Core.Models.DTO
 {
     /// <summary>
     /// 打赏表
     /// </summary>
-    public class DonateDto : DonateDtoBase
+    public class DonateDto : BaseDto
     {
+        /// <summary>
+        /// 打赏人
+        /// </summary>
+        public string NickName { get; set; }
+
+        /// <summary>
+        /// 打赏金额
+        /// </summary>
+        public string Amount { get; set; }
+
+        /// <summary>
+        /// 打赏途径
+        /// </summary>
+        public string Via { get; set; }
+
+        /// <summary>
+        /// 打赏时间
+        /// </summary>
+        public DateTime DonateTime { get; set; }
 
         /// <summary>
         /// 打赏人邮箱
@@ -15,6 +36,5 @@
         /// 打赏人的QQ或微信
         /// </summary>
         public string QQorWechat { get; set; }
-
     }
 }

+ 0 - 40
src/Masuit.MyBlogs.Core/Models/DTO/DonateDtoBase.cs

@@ -1,40 +0,0 @@
-using System;
-
-namespace Masuit.MyBlogs.Core.Models.DTO
-{
-    /// <summary>
-    /// 打赏表
-    /// </summary>
-    public class DonateDtoBase : BaseDto
-    {
-        /// <summary>
-        /// 打赏人
-        /// </summary>
-        public string NickName { get; set; }
-
-        /// <summary>
-        /// 打赏人的显式邮箱
-        /// </summary>
-        public string EmailDisplay { get; set; }
-
-        /// <summary>
-        /// 打赏人的显式QQ或微信
-        /// </summary>
-        public string QQorWechatDisplay { get; set; }
-
-        /// <summary>
-        /// 打赏金额
-        /// </summary>
-        public string Amount { get; set; }
-
-        /// <summary>
-        /// 打赏途径
-        /// </summary>
-        public string Via { get; set; }
-
-        /// <summary>
-        /// 打赏时间
-        /// </summary>
-        public DateTime DonateTime { get; set; }
-    }
-}

+ 0 - 10
src/Masuit.MyBlogs.Core/Models/Entity/Donate.cs

@@ -24,16 +24,6 @@ namespace Masuit.MyBlogs.Core.Models.Entity
         /// </summary>
         public string QQorWechat { get; set; }
 
-        /// <summary>
-        /// 打赏人的显式邮箱
-        /// </summary>
-        public string EmailDisplay { get; set; }
-
-        /// <summary>
-        /// 打赏人的显式QQ或微信
-        /// </summary>
-        public string QQorWechatDisplay { get; set; }
-
         /// <summary>
         /// 打赏金额
         /// </summary>

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

@@ -125,10 +125,10 @@
                 {{row.NickName}}
             </td>
             <td title="'邮箱'" sortable="'Email'">
-                {{row.EmailDisplay}}
+                {{row.Email}}
             </td>
             <td title="'QQ或微信'" sortable="'QQorWechat'">
-                {{row.QQorWechatDisplay}}
+                {{row.QQorWechat}}
             </td>
             <td title="'金额'" sortable="'Amount'">
                 {{row.Amount}}

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

@@ -139,12 +139,6 @@
             <td title="'QQ或微信'">
                 {{row.QQorWechat}}
             </td>
-            <td title="'显示邮箱'">
-                {{row.EmailDisplay}}
-            </td>
-            <td title="'显示QQ或微信'">
-                {{row.QQorWechatDisplay}}
-            </td>
             <td title="'操作'">
                 <button class="btn btn-default btn-sm" ng-click="save(row)">编辑</button>
                 <button class="btn btn-danger btn-sm" ng-click="list.del(row)">删除</button>
@@ -258,9 +252,7 @@
                     DonateTime: "",
                     Amount: "",
                     Email: "",
-                    EmailDisplay: "",
                     QQorWechat: "",
-                    QQorWechatDisplay: "",
                     Via: ""
                 };
             }
@@ -272,9 +264,7 @@
                     '<div class="input-group"><span class="input-group-addon">打赏金额: </span><input id="amount" type="text" class="form-control input-lg" placeholder="请输入金额" value="' + row.Amount + '"></div>' +
                     '<div class="input-group"><span class="input-group-addon">打赏方式: </span><input id="via" type="text" class="form-control input-lg" placeholder="请输入打赏方式" value="' + row.Via + '"></div>' +
                     '<div class="input-group"><span class="input-group-addon">Email: </span><input type="email" id="email" class="form-control input-lg" placeholder="请输入Email" value="' + row.Email + '"></div>' +
-                    '<div class="input-group"><span class="input-group-addon">QQ或微信: </span><input type="text" id="qq" class="form-control input-lg" placeholder="请输入QQ或微信" value="' + row.QQorWechat + '"></div>' +
-                    '<div class="input-group"><span class="input-group-addon">显示Email: </span><input type="text" id="demail" class="form-control input-lg" placeholder="请输入显示Email" value="' + row.EmailDisplay + '"></div>' +
-                    '<div class="input-group"><span class="input-group-addon">显示QQ或微信: </span><input type="text" id="dqq" class="form-control input-lg" placeholder="请输入显示QQ或微信" value="' + row.QQorWechatDisplay + '"></div>',
+                    '<div class="input-group"><span class="input-group-addon">QQ或微信: </span><input type="text" id="qq" class="form-control input-lg" placeholder="请输入QQ或微信" value="' + row.QQorWechat + '"></div>',
                 showCloseButton: true,
                 confirmButtonColor: "#DD6B55",
                 confirmButtonText: "确定",
@@ -290,8 +280,6 @@
                         row.Via = $("#via").val();
                         row.Email = $("#email").val();
                         row.QQorWechat = $("#qq").val();
-                        row.EmailDisplay = $("#demail").val();
-                        row.QQorWechatDisplay = $("#dqq").val();
                         $http.post("/donate/save", row).then(function (res) {
                             if (res.data.Success) {
                                 resolve(res.data);

+ 1 - 7
src/Masuit.MyBlogs.Core/wwwroot/ng-views/controllers/donate.js

@@ -71,9 +71,7 @@
 				DonateTime: "",
 				Amount: "",
 				Email: "",
-				EmailDisplay: "",
 				QQorWechat: "",
-				QQorWechatDisplay: "",
 				Via:""
 			};
 		}
@@ -84,9 +82,7 @@
 			'<div class="input-group"><span class="input-group-addon">打赏金额: </span><input id="amount" type="text" class="form-control input-lg" placeholder="请输入金额" value="' + row.Amount +'"></div>' +
 			'<div class="input-group"><span class="input-group-addon">打赏方式: </span><input id="via" type="text" class="form-control input-lg" placeholder="请输入打赏方式" value="' + row.Via +'"></div>' +
 			'<div class="input-group"><span class="input-group-addon">Email: </span><input type="email" id="email" class="form-control input-lg" placeholder="请输入Email" value="' + row.Email +'"></div>' +
-			'<div class="input-group"><span class="input-group-addon">QQ或微信: </span><input type="text" id="qq" class="form-control input-lg" placeholder="请输入QQ或微信" value="' + row.QQorWechat +'"></div>' +
-			'<div class="input-group"><span class="input-group-addon">显示Email: </span><input type="text" id="demail" class="form-control input-lg" placeholder="请输入显示Email" value="' + row.EmailDisplay +'"></div>' +
-			'<div class="input-group"><span class="input-group-addon">显示QQ或微信: </span><input type="text" id="dqq" class="form-control input-lg" placeholder="请输入显示QQ或微信" value="' + row.QQorWechatDisplay +'"></div>',
+			'<div class="input-group"><span class="input-group-addon">QQ或微信: </span><input type="text" id="qq" class="form-control input-lg" placeholder="请输入QQ或微信" value="' + row.QQorWechat +'"></div>',
 			showCloseButton: true,
 			confirmButtonColor: "#DD6B55",
 			confirmButtonText: "确定",
@@ -102,8 +98,6 @@
 					row.Via = $("#via").val();
 					row.Email = $("#email").val();
 					row.QQorWechat = $("#qq").val();
-					row.EmailDisplay = $("#demail").val();
-					row.QQorWechatDisplay = $("#dqq").val();
 					$http.post("/donate/save", row).then(function (res) {
 						if (res.data.Success) {
 							resolve(res.data);

+ 0 - 6
src/Masuit.MyBlogs.Core/wwwroot/ng-views/views/donate.html

@@ -38,12 +38,6 @@
             <td title="'QQ或微信'">
                 {{row.QQorWechat}}
             </td>
-            <td title="'显示邮箱'">
-                {{row.EmailDisplay}}
-            </td>
-            <td title="'显示QQ或微信'">
-                {{row.QQorWechatDisplay}}
-            </td>
             <td title="'操作'" style="width: 120px;">
                 <div class="btn-group">
                     <button class="btn btn-default btn-sm waves-effect" ng-click="save(row)">