Sfoglia il codice sorgente

删除漏洞提交功能

懒得勤快 6 anni fa
parent
commit
dadedee2da

+ 0 - 196
src/Masuit.MyBlogs.Core/Controllers/BugController.cs

@@ -1,196 +0,0 @@
-using Common;
-using Hangfire;
-using Masuit.LuceneEFCore.SearchEngine.Interfaces;
-using Masuit.MyBlogs.Core.Extensions;
-using Masuit.MyBlogs.Core.Infrastructure.Application;
-using Masuit.MyBlogs.Core.Infrastructure.Services.Interface;
-using Masuit.MyBlogs.Core.Models.DTO;
-using Masuit.MyBlogs.Core.Models.Entity;
-using Masuit.MyBlogs.Core.Models.Enum;
-using Masuit.MyBlogs.Core.Models.RequestModels;
-using Masuit.MyBlogs.Core.Models.ViewModel;
-using Masuit.Tools.Systems;
-using Microsoft.AspNetCore.Hosting;
-using Microsoft.AspNetCore.Mvc;
-using Microsoft.Net.Http.Headers;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text.RegularExpressions;
-
-namespace Masuit.MyBlogs.Core.Controllers
-{
-    /// <summary>
-    /// bug反馈
-    /// </summary>
-    public class BugController : BaseController
-    {
-        /// <summary>
-        /// IssueService
-        /// </summary>
-        private IIssueService IssueService { get; set; }
-
-        /// <summary>
-        /// MessageService
-        /// </summary>
-        private IInternalMessageService MessageService { get; set; }
-
-        private readonly IHostingEnvironment _hostingEnvironment;
-        private readonly ISearchEngine<DataContext> _searchEngine;
-
-        /// <summary>
-        /// bug反馈
-        /// </summary>
-        /// <param name="issueService"></param>
-        /// <param name="messageService"></param>
-        /// <param name="hostingEnvironment"></param>
-        /// <param name="searchEngine"></param>
-        public BugController(IIssueService issueService, IInternalMessageService messageService, IHostingEnvironment hostingEnvironment, ISearchEngine<DataContext> searchEngine)
-        {
-            IssueService = issueService;
-            MessageService = messageService;
-            _hostingEnvironment = hostingEnvironment;
-            _searchEngine = searchEngine;
-        }
-
-        /// <summary>
-        /// bug首页
-        /// </summary>
-        /// <returns></returns>
-        [Route("bug"), ResponseCache(Duration = 600, VaryByHeader = HeaderNames.Cookie)]
-        public ActionResult Index()
-        {
-            return View();
-        }
-
-        /// <summary>
-        /// 分页数据
-        /// </summary>
-        /// <param name="filter"></param>
-        /// <returns></returns>
-        [HttpPost]
-        public ActionResult PageData([FromBody]PageFilter filter)
-        {
-            UserInfoOutputDto user = HttpContext.Session.GetByRedis<UserInfoOutputDto>(SessionKey.UserInfo) ?? new UserInfoOutputDto();
-            List<Issue> list;
-            int total;
-            if (string.IsNullOrEmpty(filter.Kw))
-            {
-                list = IssueService.LoadPageEntitiesFromL2CacheNoTracking(filter.Page, filter.Size, out total, i => i.Status != Status.Handled && i.Level != BugLevel.Fatal || user.IsAdmin, i => i.SubmitTime, false).ToList();
-            }
-            else
-            {
-                var searchResult = IssueService.SearchPage(filter.Page, filter.Size, filter.Kw);
-                total = searchResult.Total;
-                list = searchResult.Results;
-            }
-
-            var pageCount = Math.Ceiling(total * 1.0 / filter.Size).ToInt32();
-            return PageResult(list.Select(i => new
-            {
-                i.Id,
-                i.Name,
-                //i.Email,
-                i.Title,
-                i.Link,
-                i.Description,
-                i.SubmitTime,
-                i.HandleTime,
-                Status = i.Status.GetDisplay(),
-                Level = i.Level.GetDisplay()
-            }), pageCount, total);
-        }
-
-        /// <summary>
-        /// 问题详情
-        /// </summary>
-        /// <param name="id"></param>
-        /// <returns></returns>
-        [Route("bug/{id:int}"), ResponseCache(Duration = 600, VaryByQueryKeys = new[] { "id" }, VaryByHeader = HeaderNames.Cookie)]
-        public ActionResult Datails(int id)
-        {
-            Issue issue = IssueService.GetById(id);
-            if (issue is null)
-            {
-                return RedirectToAction("Index", "Error");
-            }
-            return View(issue);
-        }
-
-        /// <summary>
-        /// 处理
-        /// </summary>
-        /// <returns></returns>
-        [Authority,]
-        public ActionResult Handle([FromBody]IssueHandleRequest req)
-        {
-            Issue issue = IssueService.GetById(req.Id);
-            issue.Status = Status.Handled;
-            issue.HandleTime = DateTime.Now;
-            issue.Msg = req.Text;
-            IssueService.UpdateEntity(issue);
-            bool b = _searchEngine.SaveChanges() > 0;
-            string content = System.IO.File.ReadAllText(_hostingEnvironment.WebRootPath + "/template/bugfeed.html").Replace("{{title}}", issue.Title).Replace("{{link}}", issue.Link).Replace("{{text}}", req.Text).Replace("{{date}}", issue.HandleTime.Value.ToString("yyyy-MM-dd HH:mm:ss"));
-            BackgroundJob.Enqueue(() => CommonHelper.SendMail("bug提交反馈通知", content, issue.Email));
-            return ResultData(null, b, b ? "问题处理成功!" : "处理失败!");
-        }
-
-        /// <summary>
-        /// 提交问题
-        /// </summary>
-        /// <param name="issue"></param>
-        /// <returns></returns>
-        [HttpPost]
-        public ActionResult Submit([FromBody]Issue issue)
-        {
-            issue.Description = CommonHelper.ReplaceImgSrc(Regex.Replace(issue.Description, @"<img\s+[^>]*\s*src\s*=\s*['""]?(\S+\.\w{3,4})['""]?[^/>]*/>", "<img src=\"$1\"/>")).Replace("/thumb150/", "/large/");
-            issue.IPAddress = HttpContext.Connection.RemoteIpAddress.MapToIPv4().ToString();
-            IssueService.AddEntity(issue);
-            bool b = _searchEngine.SaveChanges(issue.Level < BugLevel.Fatal) > 0;
-            if (b)
-            {
-                MessageService.AddEntitySaved(new InternalMessage()
-                {
-                    Title = $"来自【{issue.Name}({issue.Email})】的bug问题反馈",
-                    Content = issue.Description,
-                    Link = Url.Action("Index")
-                });
-                string content = System.IO.File.ReadAllText(_hostingEnvironment.WebRootPath + "/template/bugreport.html").Replace("{{name}}", issue.Name).Replace("{{email}}", issue.Email).Replace("{{title}}", issue.Title).Replace("{{desc}}", issue.Description).Replace("{{link}}", issue.Link).Replace("{{date}}", issue.SubmitTime.ToString("yyyy-MM-dd HH:mm:ss"));
-                BackgroundJob.Enqueue(() => CommonHelper.SendMail("bug提交通知", content, "[email protected]"));
-                return ResultData(issue, true, "问题提交成功,感谢您的反馈!");
-            }
-            return ResultData(null, false, "提交失败!");
-        }
-
-        /// <summary>
-        /// 删除问题
-        /// </summary>
-        /// <param name="req">问题id</param>
-        /// <returns></returns>
-        [Authority]
-        public ActionResult Delete([FromBody]RequestModelBase req)
-        {
-            bool b = IssueService.DeleteByIdSaved(req.Id);
-            return ResultData(null, b, b ? "删除成功!" : "删除失败!");
-        }
-
-        /// <summary>
-        /// 获取问题级别
-        /// </summary>
-        /// <returns></returns>
-        [ResponseCache(Duration = 600)]
-        public ActionResult GetBugLevels()
-        {
-            List<object> list = new List<object>();
-            foreach (Enum value in Enum.GetValues(typeof(BugLevel)))
-            {
-                list.Add(new
-                {
-                    name = value.GetDisplay(),
-                    value
-                });
-            }
-            return ResultData(list);
-        }
-    }
-}

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

@@ -235,7 +235,7 @@ namespace Masuit.MyBlogs.Core.Controllers
             var hot6Post = postList.OrderByDescending(order).Skip(0).Take(5).Cacheable().ToList(); //热门文章
             var topPostWeek = PostService.SqlQuery<SimplePostModel>("SELECT [Id],[Title] from Post WHERE Id in (SELECT top 10 PostId FROM [dbo].[PostAccessRecord] where DATEDIFF(week,AccessTime,getdate())<=1 GROUP BY PostId ORDER BY sum(ClickCount) desc)").ToList(); //文章周排行
             var topPostMonth = PostService.SqlQuery<SimplePostModel>("SELECT [Id],[Title] from Post WHERE Id in (SELECT top 10 PostId FROM [dbo].[PostAccessRecord] where DATEDIFF(month,AccessTime,getdate())<=1 GROUP BY PostId ORDER BY sum(ClickCount) desc)").ToList(); //文章月排行
-            var topPostYear = PostService.SqlQuery<SimplePostModel>("SELECT [Id],[Title] from Post WHERE Id in (SELECT top 10 PostId FROM [dbo].[PostAccessRecord] where DATEDIFF(year,AccessTime,getdate())<=1 GROUP BY PostId ORDER BY sum(ClickCount) desc)").ToList(); //文章年度排行
+            var topPostToday = PostService.SqlQuery<SimplePostModel>("SELECT [Id],[Title] from Post WHERE Id in (SELECT top 10 PostId FROM [dbo].[PostAccessRecord] where DATEDIFF(day,AccessTime,getdate())<=1 GROUP BY PostId ORDER BY sum(ClickCount) desc)").ToList(); //文章今日排行
             var tags = new List<string>(); //标签云
             var tagdic = new Dictionary<string, int>();
             var newdic = new Dictionary<string, int>(); //标签云最终结果
@@ -295,7 +295,7 @@ namespace Masuit.MyBlogs.Core.Controllers
                 Top6Post = hot6Post,
                 TopPostByMonth = topPostMonth,
                 TopPostByWeek = topPostWeek,
-                TopPostByYear = topPostYear,
+                TopPostByToday = topPostToday,
                 PostsQueryable = postList
             };
         }

+ 2 - 6
src/Masuit.MyBlogs.Core/Extensions/Hangfire/HangfireBackJob.cs

@@ -210,13 +210,9 @@ namespace Masuit.MyBlogs.Core.Extensions.Hangfire
         {
             _searchEngine.CreateIndex(new List<string>()
             {
-                nameof(DataContext.Post),nameof(DataContext.Issues),
+                nameof(DataContext.Post),
             });
-            var list1 = _searchEngine.Context.Issues.Where(i => i.Status != Status.Handled && i.Level != BugLevel.Fatal).ToList();
-            var list2 = _searchEngine.Context.Post.Where(i => i.Status != Status.Pended).ToList();
-            var list = new List<LuceneIndexableBaseEntity>();
-            list.AddRange(list1);
-            list.AddRange(list2);
+            var list = _searchEngine.Context.Post.Where(i => i.Status != Status.Pended).ToList();
             _searchEngine.LuceneIndexer.Delete(list);
         }
     }

+ 0 - 1
src/Masuit.MyBlogs.Core/Infrastructure/Application/DataContext.cs

@@ -69,7 +69,6 @@ namespace Masuit.MyBlogs.Core.Infrastructure.Application
         public virtual DbSet<SeminarPost> SeminarPosts { get; set; }
         public virtual DbSet<SeminarPostHistoryVersion> SeminarPostHistoryVersions { get; set; }
         public virtual DbSet<PostAccessRecord> PostAccessRecord { get; set; }
-        public virtual DbSet<Issue> Issues { get; set; }
         public virtual DbSet<InternalMessage> InternalMessage { get; set; }
         public virtual DbSet<FastShare> FastShare { get; set; }
 

+ 0 - 2
src/Masuit.MyBlogs.Core/Infrastructure/Repository/Interface/IBaseRepository.cs

@@ -546,8 +546,6 @@ namespace Masuit.MyBlogs.Core.Infrastructure.Repository.Interface
 
     public partial interface IInternalMessageRepository : IBaseRepository<InternalMessage> { }
 
-    public partial interface IIssueRepository : IBaseRepository<Issue> { }
-
     public partial interface ILeaveMessageRepository : IBaseRepository<LeaveMessage> { }
 
     public partial interface ILinksRepository : IBaseRepository<Links> { }

+ 1 - 6
src/Masuit.MyBlogs.Core/Infrastructure/Repository/Repositories.cs

@@ -41,12 +41,7 @@ namespace Masuit.MyBlogs.Core.Infrastructure.Repository
         {
         }
     }
-    public partial class IssueRepository : BaseRepository<Issue>, IIssueRepository
-    {
-        public IssueRepository(DataContext dbContext, IDbConnection connection) : base(dbContext, connection)
-        {
-        }
-    }
+
     public partial class LeaveMessageRepository : BaseRepository<LeaveMessage>, ILeaveMessageRepository
     {
         public LeaveMessageRepository(DataContext dbContext, IDbConnection connection) : base(dbContext, connection)

+ 1 - 7
src/Masuit.MyBlogs.Core/Infrastructure/Services/Interface/IServices.cs

@@ -1,5 +1,4 @@
-using Masuit.MyBlogs.Core.Models.DTO;
-using Masuit.MyBlogs.Core.Models.Entity;
+using Masuit.MyBlogs.Core.Models.Entity;
 
 namespace Masuit.MyBlogs.Core.Infrastructure.Services.Interface
 {
@@ -11,11 +10,6 @@ namespace Masuit.MyBlogs.Core.Infrastructure.Services.Interface
 
     public partial interface IInternalMessageService : IBaseService<InternalMessage> { }
 
-    public partial interface IIssueService : IBaseService<Issue>
-    {
-        SearchResult<Issue> SearchPage(int page, int size, string keyword);
-    }
-
     public partial interface ILinksService : IBaseService<Links> { }
 
     public partial interface ILoginRecordService : IBaseService<LoginRecord> { }

+ 1 - 23
src/Masuit.MyBlogs.Core/Infrastructure/Services/Services.cs

@@ -1,12 +1,8 @@
-using Masuit.LuceneEFCore.SearchEngine;
-using Masuit.LuceneEFCore.SearchEngine.Interfaces;
+using Masuit.LuceneEFCore.SearchEngine.Interfaces;
 using Masuit.MyBlogs.Core.Infrastructure.Application;
 using Masuit.MyBlogs.Core.Infrastructure.Repository.Interface;
 using Masuit.MyBlogs.Core.Infrastructure.Services.Interface;
-using Masuit.MyBlogs.Core.Models.DTO;
 using Masuit.MyBlogs.Core.Models.Entity;
-using Masuit.MyBlogs.Core.Models.Enum;
-using System.Linq;
 
 namespace Masuit.MyBlogs.Core.Infrastructure.Services
 {
@@ -38,24 +34,6 @@ namespace Masuit.MyBlogs.Core.Infrastructure.Services
         }
     }
 
-    public partial class IssueService : BaseService<Issue>, IIssueService
-    {
-        public IssueService(IBaseRepository<Issue> repository, ISearchEngine<DataContext> searchEngine, ILuceneIndexSearcher searcher) : base(repository, searchEngine, searcher)
-        {
-        }
-        public SearchResult<Issue> SearchPage(int page, int size, string keyword)
-        {
-            var searchResult = _searchEngine.ScoredSearch<Issue>(new SearchOptions(keyword, page, size, typeof(Issue)));
-            var posts = searchResult.Results.Select(p => p.Entity).Where(i => i.Status == Status.Handled).ToList();
-            return new SearchResult<Issue>()
-            {
-                Results = posts,
-                Elapsed = searchResult.Elapsed,
-                Total = searchResult.TotalHits
-            };
-        }
-    }
-
     public partial class LinksService : BaseService<Links>, ILinksService
     {
         public LinksService(IBaseRepository<Links> repository, ISearchEngine<DataContext> searchEngine, ILuceneIndexSearcher searcher) : base(repository, searchEngine, searcher)

+ 0 - 2
src/Masuit.MyBlogs.Core/Masuit.MyBlogs.Core.csproj

@@ -29,8 +29,6 @@
 
   <ItemGroup>
     <None Include="bundleconfig.json" />
-    <None Include="Views\Bug\Datails.cshtml" />
-    <None Include="Views\Bug\Index.cshtml" />
     <None Include="Views\Shared\_Layout.cshtml" />
     <None Include="wwwroot\Assets\highlight\js\highlight.js" />
     <None Include="wwwroot\ng-views\controllers\analysis.js" />

+ 1 - 131
src/Masuit.MyBlogs.Core/Masuit.MyBlogs.Core.xml

@@ -347,76 +347,6 @@
             <summary>在调用操作方法后调用。</summary>
             <param name="filterContext">有关当前请求和操作的信息。</param>
         </member>
-        <member name="T:Masuit.MyBlogs.Core.Controllers.BugController">
-            <summary>
-            bug反馈
-            </summary>
-        </member>
-        <member name="P:Masuit.MyBlogs.Core.Controllers.BugController.IssueService">
-            <summary>
-            IssueService
-            </summary>
-        </member>
-        <member name="P:Masuit.MyBlogs.Core.Controllers.BugController.MessageService">
-            <summary>
-            MessageService
-            </summary>
-        </member>
-        <member name="M:Masuit.MyBlogs.Core.Controllers.BugController.#ctor(Masuit.MyBlogs.Core.Infrastructure.Services.Interface.IIssueService,Masuit.MyBlogs.Core.Infrastructure.Services.Interface.IInternalMessageService,Microsoft.AspNetCore.Hosting.IHostingEnvironment,Masuit.LuceneEFCore.SearchEngine.Interfaces.ISearchEngine{Masuit.MyBlogs.Core.Infrastructure.Application.DataContext})">
-            <summary>
-            bug反馈
-            </summary>
-            <param name="issueService"></param>
-            <param name="messageService"></param>
-            <param name="hostingEnvironment"></param>
-            <param name="searchEngine"></param>
-        </member>
-        <member name="M:Masuit.MyBlogs.Core.Controllers.BugController.Index">
-            <summary>
-            bug首页
-            </summary>
-            <returns></returns>
-        </member>
-        <member name="M:Masuit.MyBlogs.Core.Controllers.BugController.PageData(Masuit.MyBlogs.Core.Models.RequestModels.PageFilter)">
-            <summary>
-            分页数据
-            </summary>
-            <param name="filter"></param>
-            <returns></returns>
-        </member>
-        <member name="M:Masuit.MyBlogs.Core.Controllers.BugController.Datails(System.Int32)">
-            <summary>
-            问题详情
-            </summary>
-            <param name="id"></param>
-            <returns></returns>
-        </member>
-        <member name="M:Masuit.MyBlogs.Core.Controllers.BugController.Handle(Masuit.MyBlogs.Core.Models.RequestModels.IssueHandleRequest)">
-            <summary>
-            处理
-            </summary>
-            <returns></returns>
-        </member>
-        <member name="M:Masuit.MyBlogs.Core.Controllers.BugController.Submit(Masuit.MyBlogs.Core.Models.Entity.Issue)">
-            <summary>
-            提交问题
-            </summary>
-            <param name="issue"></param>
-            <returns></returns>
-        </member>
-        <member name="M:Masuit.MyBlogs.Core.Controllers.BugController.Delete(Masuit.MyBlogs.Core.Models.RequestModels.RequestModelBase)">
-            <summary>
-            删除问题
-            </summary>
-            <param name="req">问题id</param>
-            <returns></returns>
-        </member>
-        <member name="M:Masuit.MyBlogs.Core.Controllers.BugController.GetBugLevels">
-            <summary>
-            获取问题级别
-            </summary>
-            <returns></returns>
-        </member>
         <member name="T:Masuit.MyBlogs.Core.Controllers.CategoryController">
             <summary>
             文章分类
@@ -6237,66 +6167,6 @@
             已读状态
             </summary>
         </member>
-        <member name="T:Masuit.MyBlogs.Core.Models.Entity.Issue">
-            <summary>
-            网站问题
-            </summary>
-        </member>
-        <member name="P:Masuit.MyBlogs.Core.Models.Entity.Issue.Name">
-            <summary>
-            提交人昵称
-            </summary>
-        </member>
-        <member name="P:Masuit.MyBlogs.Core.Models.Entity.Issue.Email">
-            <summary>
-            提交人邮箱
-            </summary>
-        </member>
-        <member name="P:Masuit.MyBlogs.Core.Models.Entity.Issue.Title">
-            <summary>
-            问题标题
-            </summary>
-        </member>
-        <member name="P:Masuit.MyBlogs.Core.Models.Entity.Issue.Link">
-            <summary>
-            存在问题的页面链接
-            </summary>
-        </member>
-        <member name="P:Masuit.MyBlogs.Core.Models.Entity.Issue.Description">
-            <summary>
-            问题的详细描述
-            </summary>
-        </member>
-        <member name="P:Masuit.MyBlogs.Core.Models.Entity.Issue.Level">
-            <summary>
-            问题严重级别
-            </summary>
-        </member>
-        <member name="P:Masuit.MyBlogs.Core.Models.Entity.Issue.SubmitTime">
-            <summary>
-            提交时间
-            </summary>
-        </member>
-        <member name="P:Masuit.MyBlogs.Core.Models.Entity.Issue.HandleTime">
-            <summary>
-            处理时间
-            </summary>
-        </member>
-        <member name="P:Masuit.MyBlogs.Core.Models.Entity.Issue.Msg">
-            <summary>
-            开发者回信
-            </summary>
-        </member>
-        <member name="P:Masuit.MyBlogs.Core.Models.Entity.Issue.IPAddress">
-            <summary>
-            提交人IP
-            </summary>
-        </member>
-        <member name="T:Masuit.MyBlogs.Core.Models.Entity.BugLevel">
-            <summary>
-            问题级别
-            </summary>
-        </member>
         <member name="T:Masuit.MyBlogs.Core.Models.Entity.LeaveMessage">
             <summary>
             留言板
@@ -7179,7 +7049,7 @@
             文章月排行
             </summary>
         </member>
-        <member name="P:Masuit.MyBlogs.Core.Models.ViewModel.IndexPageViewModel.TopPostByYear">
+        <member name="P:Masuit.MyBlogs.Core.Models.ViewModel.IndexPageViewModel.TopPostByToday">
             <summary>
             文章年度排行
             </summary>

+ 2 - 40
src/Masuit.MyBlogs.Core/Migrations/20190224061047_Init.Designer.cs → src/Masuit.MyBlogs.Core/Migrations/20190303082558_Init.Designer.cs

@@ -1,16 +1,15 @@
 // <auto-generated />
-using System;
 using Masuit.MyBlogs.Core.Infrastructure.Application;
 using Microsoft.EntityFrameworkCore;
 using Microsoft.EntityFrameworkCore.Infrastructure;
 using Microsoft.EntityFrameworkCore.Metadata;
 using Microsoft.EntityFrameworkCore.Migrations;
-using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+using System;
 
 namespace Masuit.MyBlogs.Core.Migrations
 {
     [DbContext(typeof(DataContext))]
-    [Migration("20190224061047_Init")]
+    [Migration("20190303082558_Init")]
     partial class Init
     {
         protected override void BuildTargetModel(ModelBuilder modelBuilder)
@@ -178,43 +177,6 @@ namespace Masuit.MyBlogs.Core.Migrations
                     b.ToTable("InternalMessage");
                 });
 
-            modelBuilder.Entity("Masuit.MyBlogs.Core.Models.Entity.Issue", b =>
-                {
-                    b.Property<int>("Id")
-                        .ValueGeneratedOnAdd()
-                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
-
-                    b.Property<string>("Description")
-                        .IsRequired();
-
-                    b.Property<string>("Email");
-
-                    b.Property<DateTime?>("HandleTime");
-
-                    b.Property<string>("IPAddress");
-
-                    b.Property<int>("Level");
-
-                    b.Property<string>("Link")
-                        .IsRequired();
-
-                    b.Property<string>("Msg");
-
-                    b.Property<string>("Name")
-                        .IsRequired();
-
-                    b.Property<int>("Status");
-
-                    b.Property<DateTime>("SubmitTime");
-
-                    b.Property<string>("Title")
-                        .IsRequired();
-
-                    b.HasKey("Id");
-
-                    b.ToTable("Issue");
-                });
-
             modelBuilder.Entity("Masuit.MyBlogs.Core.Models.Entity.LeaveMessage", b =>
                 {
                     b.Property<int>("Id")

+ 0 - 21
src/Masuit.MyBlogs.Core/Migrations/20190224061047_Init.cs → src/Masuit.MyBlogs.Core/Migrations/20190303082558_Init.cs

@@ -75,25 +75,6 @@ namespace Masuit.MyBlogs.Core.Migrations
                 table.PrimaryKey("PK_InternalMessage", x => x.Id);
             });
 
-            migrationBuilder.CreateTable(name: "Issue", columns: table => new
-            {
-                Id = table.Column<int>(nullable: false).Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
-                Status = table.Column<int>(nullable: false),
-                Name = table.Column<string>(nullable: false),
-                Email = table.Column<string>(nullable: true),
-                Title = table.Column<string>(nullable: false),
-                Link = table.Column<string>(nullable: false),
-                Description = table.Column<string>(nullable: false),
-                Level = table.Column<int>(nullable: false),
-                SubmitTime = table.Column<DateTime>(nullable: false),
-                HandleTime = table.Column<DateTime>(nullable: true),
-                Msg = table.Column<string>(nullable: true),
-                IPAddress = table.Column<string>(nullable: true)
-            }, constraints: table =>
-            {
-                table.PrimaryKey("PK_Issue", x => x.Id);
-            });
-
             migrationBuilder.CreateTable(name: "LeaveMessage", columns: table => new
             {
                 Id = table.Column<int>(nullable: false).Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
@@ -384,8 +365,6 @@ namespace Masuit.MyBlogs.Core.Migrations
 
             migrationBuilder.DropTable(name: "InternalMessage");
 
-            migrationBuilder.DropTable(name: "Issue");
-
             migrationBuilder.DropTable(name: "LeaveMessage");
 
             migrationBuilder.DropTable(name: "Links");

+ 0 - 31
src/Masuit.MyBlogs.Core/Migrations/DataContextModelSnapshot.cs

@@ -154,37 +154,6 @@ namespace Masuit.MyBlogs.Core.Migrations
                 b.ToTable("InternalMessage");
             });
 
-            modelBuilder.Entity("Masuit.MyBlogs.Core.Models.Entity.Issue", b =>
-            {
-                b.Property<int>("Id").ValueGeneratedOnAdd().HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
-
-                b.Property<string>("Description").IsRequired();
-
-                b.Property<string>("Email");
-
-                b.Property<DateTime?>("HandleTime");
-
-                b.Property<string>("IPAddress");
-
-                b.Property<int>("Level");
-
-                b.Property<string>("Link").IsRequired();
-
-                b.Property<string>("Msg");
-
-                b.Property<string>("Name").IsRequired();
-
-                b.Property<int>("Status");
-
-                b.Property<DateTime>("SubmitTime");
-
-                b.Property<string>("Title").IsRequired();
-
-                b.HasKey("Id");
-
-                b.ToTable("Issue");
-            });
-
             modelBuilder.Entity("Masuit.MyBlogs.Core.Models.Entity.LeaveMessage", b =>
             {
                 b.Property<int>("Id").ValueGeneratedOnAdd().HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

+ 0 - 90
src/Masuit.MyBlogs.Core/Models/Entity/Issue.cs

@@ -1,90 +0,0 @@
-using Masuit.LuceneEFCore.SearchEngine;
-using Masuit.MyBlogs.Core.Models.Enum;
-using Masuit.MyBlogs.Core.Models.Validation;
-using System;
-using System.ComponentModel.DataAnnotations;
-using System.ComponentModel.DataAnnotations.Schema;
-
-namespace Masuit.MyBlogs.Core.Models.Entity
-{
-    /// <summary>
-    /// 网站问题
-    /// </summary>
-    [Table("Issue")]
-    public class Issue : BaseEntity
-    {
-        public Issue()
-        {
-            Status = Status.WaitingHandle;
-            SubmitTime = DateTime.Now;
-            Level = BugLevel.General;
-        }
-
-        /// <summary>
-        /// 提交人昵称
-        /// </summary>
-        [Required(ErrorMessage = "昵称不能为空!")]
-        public string Name { get; set; }
-
-        /// <summary>
-        /// 提交人邮箱
-        /// </summary>
-        [IsEmail]
-        public string Email { get; set; }
-
-        /// <summary>
-        /// 问题标题
-        /// </summary>
-        [Required(ErrorMessage = "标题不能为空!"), LuceneIndex]
-        public string Title { get; set; }
-
-        /// <summary>
-        /// 存在问题的页面链接
-        /// </summary>
-        [Required(ErrorMessage = "链接不能为空!"), LuceneIndex]
-        public string Link { get; set; }
-
-        /// <summary>
-        /// 问题的详细描述
-        /// </summary>
-        [Required(ErrorMessage = "问题描述不能为空!"), SubmitCheck(20, 5000), LuceneIndex(IsHtml = true)]
-        public string Description { get; set; }
-
-        /// <summary>
-        /// 问题严重级别
-        /// </summary>
-        [Required]
-        public BugLevel Level { get; set; }
-
-        /// <summary>
-        /// 提交时间
-        /// </summary>
-        public DateTime SubmitTime { get; set; }
-
-        /// <summary>
-        /// 处理时间
-        /// </summary>
-        public DateTime? HandleTime { get; set; }
-
-        /// <summary>
-        /// 开发者回信
-        /// </summary>
-        public string Msg { get; set; }
-
-        /// <summary>
-        /// 提交人IP
-        /// </summary>
-        public string IPAddress { get; set; }
-    }
-
-    /// <summary>
-    /// 问题级别
-    /// </summary>
-    public enum BugLevel
-    {
-        [Display(Name = "一般")] General,
-        [Display(Name = "严重")] Serious,
-        [Display(Name = "异常")] Exception,
-        [Display(Name = "致命")] Fatal
-    }
-}

+ 1 - 1
src/Masuit.MyBlogs.Core/Models/ViewModel/IndexPageViewModel.cs

@@ -52,7 +52,7 @@ namespace Masuit.MyBlogs.Core.Models.ViewModel
         /// <summary>
         /// 文章年度排行
         /// </summary>
-        public List<SimplePostModel> TopPostByYear { get; set; }
+        public List<SimplePostModel> TopPostByToday { get; set; }
 
         /// <summary>
         /// 热门文章

+ 0 - 110
src/Masuit.MyBlogs.Core/Views/Bug/Datails.cshtml

@@ -1,110 +0,0 @@
-@using System.Text.RegularExpressions
-@using Common
-@using Masuit.MyBlogs.Core.Models.Enum
-@using Masuit.Tools.Systems
-@model Masuit.MyBlogs.Core.Models.Entity.Issue
-@{
-    ViewBag.Title = Model.Title;
-    Layout = "~/Views/Shared/_Layout.cshtml";
-}
-<div class="container">
-    <ol class="cd-breadcrumb triangle">
-        <li>@Html.ActionLink("首页", "Index", "Home")</li>
-        <li>@Html.ActionLink("提交网站漏洞和BUG", "Index", "Bug")</li>
-        <li class="current">
-            <em>@ViewBag.Title</em>
-        </li>
-    </ol>
-    <div class="wrapper-content article">
-        <div class="ibox">
-            <div class="ibox-content">
-                <main>
-                    <section>
-                        <header class="page-header">
-                            <div class="text-center">
-                                <a>
-                                    <h3 class="padding-bot10">
-                                        存在的问题:@Model.Title
-                                    </h3>
-                                </a>
-                            </div>
-                            <div class="row">
-                                <div class="col-sm-9">
-                                    <div class="padding-bot10">
-                                        提交人:<span class="label label-info">@Model.Name (@Model.Email)</span> | 提交时间:<span class="label label-danger">@Model.SubmitTime.ToString("yyyy-MM-dd HH:mm")</span> | 问题级别:<span class="label label-danger">@Model.Level.GetDisplay()</span>
-                                    </div>
-                                </div>
-                                <div class="pull-right margin-right20">
-                                    @if(Model.Status == Status.WaitingHandle) {
-                                        <span class="label label-danger">@Model.Status.GetDisplay()</span>
-                                    } else {
-                                        <span class="label label-success">@Model.Status.GetDisplay()</span><span> 处理时间:<span class="label label-success">@Model.HandleTime.Value.ToString("yyyy-MM-dd HH:mm")</span></span>
-                                    }
-                                </div>
-                            </div>
-                            <div class="row">
-                                <div class="col-sm-12">
-                                    存在问题的链接:<a href="@Model.Link">@Model.Link</a>
-                                </div>
-                            </div>
-                        </header>
-                        <article class="article" id="article">
-                            <h3>问题详细描述:</h3>
-                            @Html.Raw(Regex.Replace(Model.Description, @"<img\s+[^>]*\s*src\s*=\s*['""]?(\S+\.\w{3,4})['""]?[^/>]*/>", $"<img data-original=\"$1\" alt='{CommonHelper.SystemSettings["Title"]}' title='{CommonHelper.SystemSettings["Title"]}'/>"))
-                        </article>
-                    </section>
-                </main>
-                @if(Model.Status == Status.Handled) {
-                    <section class="wow pulse padding-bot20">
-                        <h3>博主回应:</h3>
-                        <p class="size16">
-                            @Html.Raw(Model.Msg)
-                        </p>
-                    </section>
-                }
-                <!--PC和WAP自适应版-->
-                <div id="SOHUCS" sid="[email protected]"></div>
-                <script type="text/javascript">
-	                (function() {
-		                var appid = 'cytsT3QgK';
-		                var conf = 'prod_0358240040a6c9611add9de991099d42';
-		                var width = window.innerWidth || document.documentElement.clientWidth;
-		                if (width < 960) {
-			                window.document.write(
-				                '<script id="changyan_mobile_js" charset="utf-8" type="text/javascript" src="https://changyan.sohu.com/upload/mobile/wap-js/changyan_mobile.js?client_id=' +
-				                appid + '&conf=' + conf + '"><\/script>');
-		                } else {
-			                var loadJs = function(d, a) {
-				                var c = document.getElementsByTagName("head")[0] || document.head || document.documentElement;
-				                var b = document.createElement("script");
-				                b.setAttribute("type", "text/javascript");
-				                b.setAttribute("charset", "UTF-8");
-				                b.setAttribute("src", d);
-				                if (typeof a === "function") {
-					                if (window.attachEvent) {
-						                b.onreadystatechange = function() {
-							                var e = b.readyState;
-							                if (e === "loaded" || e === "complete") {
-								                b.onreadystatechange = null;
-								                a()
-							                }
-						                }
-					                } else {
-						                b.onload = a
-					                }
-				                }
-				                c.appendChild(b)
-			                };
-			                loadJs("https://changyan.sohu.com/upload/changyan.js", function() {
-				                window.changyan.api.config({
-					                appid: appid,
-					                conf: conf
-				                })
-			                });
-		                }
-	                })();
-                </script>
-            </div>
-        </div>
-    </div>
-</div>

+ 0 - 148
src/Masuit.MyBlogs.Core/Views/Bug/Index.cshtml

@@ -1,148 +0,0 @@
-@{
-    ViewBag.Title = "提交网站漏洞和BUG";
-    Layout = "~/Views/Shared/_Layout.cshtml";
-}
-<style>
-    .panel-danger {
-        box-shadow: deeppink 0 0 8px;
-    }
-
-    .panel-success {
-        box-shadow: darkturquoise 0 0 8px;
-    }
-
-    .panel-body img {
-        max-height: 80px !important;
-    }
-
-    .panel-body p {
-        word-break: break-all;
-    }
-</style>
-<script src="~/Assets/UEditor/ueditor.config.front.min.js"></script>
-<script src="https://apps.bdimg.com/libs/ueditor/1.4.3.1/ueditor.all.min.js"></script>
-<script src="https://cdn.bootcss.com/angular.js/1.7.7/angular.min.js"></script>
-<script src="~/Scripts/tm.pagination.js"></script>
-<script src="~/Scripts/layer/layer.js"></script>
-<div class="container" data-ng-app="myApp" data-ng-controller="home">
-    <ol class="cd-breadcrumb triangle">
-        <li>@Html.ActionLink("首页", "Index", "Home")</li>
-        <li class="current">
-            <em>@ViewBag.Title</em>
-        </li>
-    </ol>
-    <div>
-        <div class="row">
-            <div class="col-sm-6">
-                <h3 class="size20" style="line-height: 46px">注意事项:</h3>
-            </div>
-            <div class="col-sm-6">
-                <div class="btn-group pull-right">
-                    <button class="btn btn-info btn-lg" type="submit" ng-click="create()">我要提交问题</button>
-                </div>
-            </div>
-        </div>
-        <ul class="list-group text-danger">
-            <li class="list-group-item">1.本页面不仅仅可以提交本网站的漏洞或者BUG,也可以提交对网站的改进建议或功能完善等等;</li>
-            <li class="list-group-item">2.博客文章内容相关的问题,比如链接失效之类的,请直接在文章的评论区反馈即可;</li>
-            <li class="list-group-item">3.本博客项目由于是博主个人独立开发,所以漏洞和bug在所难免,而且本项目后期完善以后准备开源,所以大家尽管找bug、提bug,大家共同来完善;</li>
-            <li class="list-group-item">4.您提交问题以后,博主会立即收到您的问题,会在最快的时间内修复问题;</li>
-            <li class="list-group-item">5.提交后的任何问题都将会立即显示到下方的列表中,如果你发现了致命级别的一些bug,比如:密码泄露、XSS注入等,则需要当问题解决后才会显示到列表中。</li>
-        </ul>
-    </div>
-    <div class="search-form">
-        <div class="input-group">
-            <input type="text" placeholder="搜索问题、BUG" class="form-control input-lg" ng-model="kw" ng-change="search(kw)">
-            <div class="input-group-btn">
-                <button class="btn btn-lg btn-primary" type="submit" ng-click="search(kw)">去发现</button>
-            </div>
-        </div>
-    </div>
-    <ul class="wow media-list">
-        <li class="msg-list media" ng-cloak="" ng-repeat="item in Issues">
-            <div class="media-body">
-                <article class="panel" ng-class="{true:'panel-success',false:'panel-danger'}[item.Status=='已处理']">
-                    <header class="panel-heading">
-                        {{item.Name}}提交问题:{{item.Title}}【级别:{{item.Level}}】
-                        <a ng-href="/bug/{{item.Id}}" class="label" ng-class="{true:'label-success',false:'label-danger'}[item.Status=='已处理']">查看详情</a>
-                        <a class="label label-success" ng-if="user.IsAdmin&&item.Status=='待处理'" ng-click="handle(item.Id)">处理完成</a>
-                        <a class="label label-info" ng-if="user.IsAdmin" ng-click="delete(item.Id)">删除</a>
-                        <span class="pull-right hidden-sm hidden-xs" style="font-size: 14px;">
-                            链接地址:
-                            <a ng-href="{{item.Link}}">{{item.Link}}</a>
-                        </span>
-                    </header>
-                    <div class="panel-body" ng-bind-html="item.Description|htmlString"></div>
-                    <div class="row">
-                        <div class="col-sm-4">
-                            <span class="label" ng-class="{true:'label-success',false:'label-danger'}[item.Status=='已处理']">
-                                <i ng-class="{true:'icon-checkmark',false:'icon-bell'}[item.Status=='已处理']"></i>
-                                {{item.Status}}
-                            </span>
-                        </div>
-                        <div class="col-sm-6 pull-right text-right" style="font-size: 8px;margin-top: 3px; margin-right: 3px">
-                            <span class="text-danger">提交时间:{{item.SubmitTime|date:'yyyy-MM-dd HH:mm'}}</span>
-                            <span class="text-success" ng-if="item.Status=='已处理'">
-                                &nbsp;| 处理时间:{{item.HandleTime|date:'yyyy-MM-dd HH:mm'}}
-                            </span>
-                        </div>
-                    </div>
-                </article>
-            </div>
-        </li>
-    </ul>
-    <tm-pagination conf="paginationConf"></tm-pagination>
-    <h2 class="size24 text-primary" ng-if="conf.totalItems <= 0">如此完美?居然没有BUG!!!</h2>
-    <div style="position: fixed; left: -20000px; bottom: -20000px;">
-        <div id="bug-form" class="container-fluid">
-            <form class="form-horizontal margin-top10 margin-bot10" method="post" id="form">
-                @Html.AntiForgeryToken()
-                <div class="input-group">
-                    <span class="input-group-addon">
-                        <label for="name">昵称:</label>
-                    </span>
-                    <input type="text" class="form-control" ng-model="Issue.Name" id="name" required placeholder="昵称" maxlength="16">
-                </div>
-                <div class="input-group">
-                    <span class="input-group-addon">
-                        <label for="email">邮箱:</label>
-                    </span>
-                    <input type="email" class="form-control" ng-model="Issue.Email" id="email" required placeholder="留下您的真实邮箱,以方便接收回复" maxlength="128">
-                </div>
-                <div class="input-group">
-                    <span class="input-group-addon">
-                        <label for="title">主题:</label>
-                    </span>
-                    <input type="text" class="form-control" ng-model="Issue.Title" id="title" required placeholder="是什么问题" maxlength="32">
-                </div>
-                <div class="input-group">
-                    <span class="input-group-addon">
-                        <label for="link">链接:</label>
-                    </span>
-                    <input type="text" class="form-control" ng-model="Issue.Link" id="link" required placeholder="哪个地址出了问题,贴到这里来" maxlength="256">
-                </div>
-                <div class="input-group">
-                    <span class="input-group-addon">
-                        <label for="link">BUG级别:</label>
-                    </span>
-                    <select class="form-control" ng-model="Issue.Level" ng-options="m.value as m.name for m in BugLevels">
-                        <option value="">请选择BUG级别</option>
-                    </select>
-                </div>
-                <div class="form-group margin-clear margin-top10">
-                    <h3 class="size18">问题的详细描述:</h3>
-                    <textarea id="editor" style="height:300px;" class="ueditor" ng-model="Issue.Description" type="text/plain"></textarea>
-                </div>
-                <div class="btn-group">
-                    <button type="button" class="btn btn-info" ng-click="submit(Issue)">
-                        提交
-                    </button>
-                    <button type="button" class="btn btn-danger" ng-click="cancel()">
-                        取消
-                    </button>
-                </div>
-            </form>
-        </div>
-    </div>
-</div>
-<script src="~/Scripts/apps/app.bug.min.js"></script>

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

@@ -80,13 +80,13 @@
                 <div class="border-bot"></div>
                 <ul>
                     <li class="active">
-                        <a href="#tab-1" tab-id="1" ripple="ripple" ripple-color="#FFF">排行</a>
+                        <a href="#tab-1" tab-id="1" ripple="ripple" ripple-color="#FFF">今日排行</a>
                     </li>
                     <li>
-                        <a href="#tab-2" tab-id="2" ripple="ripple" ripple-color="#FFF">排行</a>
+                        <a href="#tab-2" tab-id="2" ripple="ripple" ripple-color="#FFF">本周排行</a>
                     </li>
                     <li>
-                        <a class="hidden-md" href="#tab-3" tab-id="3" ripple="ripple" ripple-color="#FFF">年度排行</a>
+                        <a class="hidden-md" href="#tab-3" tab-id="3" ripple="ripple" ripple-color="#FFF">排行</a>
                     </li>
                 </ul>
                 <!-- <nav class="tabs-nav">
@@ -96,7 +96,7 @@
             <div class="tabs-content" style="font-size: 14px">
                 <div tab-id="1" class="tab active">
                     <ul class="list-group text-center">
-                        @foreach (var post in Model.TopPostByWeek)
+                        @foreach (var post in Model.TopPostByToday)
                         {
                             <li class="list-group-item">
                                 @Html.ActionLink(post.Title, "Details", "Post", new { id = post.Id }, null)
@@ -106,7 +106,7 @@
                 </div>
                 <div tab-id="2" class="tab">
                     <ul class="list-group text-center">
-                        @foreach (var post in Model.TopPostByMonth)
+                        @foreach (var post in Model.TopPostByWeek)
                         {
                             <li class="list-group-item">
                                 @Html.ActionLink(post.Title, "Details", "Post", new { id = post.Id }, null)
@@ -116,7 +116,7 @@
                 </div>
                 <div tab-id="3" class="tab">
                     <ul class="list-group text-center">
-                        @foreach (var post in Model.TopPostByYear)
+                        @foreach (var post in Model.TopPostByMonth)
                         {
                             <li class="list-group-item">
                                 @Html.ActionLink(post.Title, "Details", "Post", new { id = post.Id }, null)
@@ -178,6 +178,54 @@
 
 
 
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
             </symbol>
             </svg>
         </div>

+ 0 - 227
src/Masuit.MyBlogs.Core/wwwroot/Scripts/apps/app.bug.js

@@ -1,227 +0,0 @@
-angular.module('myApp', ["tm.pagination"]).filter('htmlString', ['$sce', function($sce) {
-	return function(text) {
-		return $sce.trustAsHtml(text);
-	};
-}]).controller("home", ["$scope", "$http", "$timeout", function ($scope, $http, $timeout) {
-	$scope.Issue = { Level: 0 };
-	var user = JSON.parse(localStorage.getItem("user"));
-	if (user) {
-		$scope.Issue.Name=(user.NickName);
-		$scope.Issue.Email = (user.Email);
-	}
-	if (window.UE) {
-		if ($scope.ue) {
-		} else {
-			$scope.ue = UE.getEditor('editor', { toolbars: [[
-					'removeformat', //清除格式
-					'fontsize', //字号
-					'emotion', //表情
-					'link', //超链接
-					'paragraph', //段落格式
-					'simpleupload', //单图上传
-					'justifyleft', //居左对齐
-					'justifyright', //居右对齐
-					'justifycenter', //居中对齐
-					'forecolor', //字体颜色
-					'lineheight', //行间距
-				]], zIndex: 1000000 , initialFrameWidth: null });
-		}
-	}
-	$http.post("/passport/getuserinfo", null).then(function(res) {
-		if (res.data.Success) {
-			$scope.user = res.data.Data;
-		}
-	});
-	$http.post("/bug/getbuglevels", null).then(function(res) {
-		if (res.data.Success) {
-			$scope.BugLevels = res.data.Data;
-		}
-	});
-	$scope.paginationConf = {
-		currentPage: 1,
-		itemsPerPage: 10,
-		pagesLength: 15,
-		perPageOptions: [10, 15, 20, 30, 50, 100],
-		rememberPerPage: 'perPageItems',
-		onChange: function() {
-			$scope.GetPageData();
-		}
-	};
-	$scope.GetPageData = function() {
-		$http.post("/bug/pagedata", {
-			page: $scope.paginationConf.currentPage,
-			size: $scope.paginationConf.itemsPerPage,
-			kw: $scope.kw
-		}).then(function(res) {
-			$scope.paginationConf.totalItems = res.data.TotalCount;
-			$("div[ng-table-pagination]").remove();
-			$scope.Issues = res.data.Data;
-			window.loadingDone();
-		});
-	}
-	$scope.create = function () {
-		layer.open({
-			type: 1,
-			zIndex: 20,
-			title: '创建一个问题',
-			area: (window.screen.width > 540 ? 540 : window.screen.width) + 'px', // '340px'], //宽高
-			content: $("#bug-form"),
-			end: function () {
-				$("#bug-form").css("display", "none");
-			}
-		});
-		$(".layui-layer").insertBefore($(".layui-layer-shade"));
-	}
-	$scope.cancel = function() {
-		layer.closeAll();
-		setTimeout(function() {
-			$("#bug-form").css("display", "none");
-		}, 500);
-	}
-	$scope.submit = function(issue) {
-		window.loading();
-		issue.Description = $scope.ue.getContent();
-		if (issue.Name && issue.Name.trim().length > 17) {
-			window.notie.alert({
-				type: 4,
-				text: "名字不能为空或者超出16个字符!",
-				time: 4
-			});
-			loadingDone();
-			return;
-		}
-		if (issue.Email&&!/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/.test(
-			issue.Email.trim())) {
-			window.notie.alert({
-				type: 3,
-				text: "请输入正确的邮箱格式!",
-				time: 4
-			});
-			loadingDone();
-			return;
-		}
-		if (issue.Title&&!issue.Title.trim()) {
-			window.notie.alert({
-				type: 3,
-				text: "主题不能为空!",
-				time: 4
-			});
-			loadingDone();
-			return;
-		}
-		if (issue.Link && !issue.Link.trim()) {
-			window.notie.alert({
-				type: 3,
-				text: "链接不能为空!",
-				time: 4
-			});
-			loadingDone();
-			return;
-		}
-		if (issue.Description&&!issue.Description.trim()) {
-			window.notie.alert({
-				type: 3,
-				text: "问题描述不能为空!",
-				time: 4
-			});
-			loadingDone();
-			return;
-		}
-		issue["__RequestVerificationToken"] = $('[name="__RequestVerificationToken"]').val();
-		$http.post("/bug/submit", issue, {
-			'Content-Type': 'application/x-www-form-urlencoded'
-		}).then(function(res) {
-			var data = res.data;
-			if (data.Success) {
-				window.notie.alert({
-					type: 1,
-					text: data.Message,
-					time: 4
-				});
-				$scope.Issue = {Level:0};
-				$scope.GetPageData();
-				$scope.cancel();
-			} else {
-				window.notie.alert({
-					type: 3,
-					text: data.Message,
-					time: 4
-				});
-			}
-			loadingDone();
-		}, function() {
-			window.notie.alert({
-				type: 3,
-				text: '服务请求失败!',
-				time: 4
-			});
-			loadingDone();
-		});
-	}
-	var _timeout;
-	$scope.search = function(kw) {
-		if (_timeout) {
-			$timeout.cancel(_timeout);
-		}
-		_timeout = $timeout(function() {
-			$scope.kw = kw;
-			$scope.GetPageData();
-			_timeout = null;
-		}, 500);
-	}
-	$scope.handle = function(id) {
-		layer.prompt({
-			title: '输入反馈留言',
-			formType: 2
-		}, function(text, index) {
-			layer.close(index);
-			window.loading();
-			$http.post("/bug/handle", {
-				id,
-				text
-			}).then(function(res) {
-				var data = res.data;
-				if (data.Success) {
-					layer.msg(data.Message);
-					$scope.GetPageData();
-					$scope.cancel();
-				} else {
-					$scope.loadingDone();
-				}
-			}, function() {
-				window.notie.alert({
-					type: 3,
-					text: '服务请求失败!',
-					time: 4
-				});
-				$scope.loadingDone();
-			});
-		});
-	}
-	$scope.delete = function(id) {
-		layer.confirm('确认删除这个问题?', {
-			btn: ['确定', '取消']
-		}, function() {
-			$http.post("/bug/delete", {
-				id
-			}).then(function(res) {
-				var data = res.data;
-				if (data.Success) {
-					layer.msg(data.Message);
-					$scope.GetPageData();
-					$scope.cancel();
-				} else {
-					$scope.loadingDone();
-				}
-			}, function() {
-				window.notie.alert({
-					type: 3,
-					text: '服务请求失败!',
-					time: 4
-				});
-				$scope.loadingDone();
-			});
-		}, function() {
-		});
-	}
-}]);

File diff suppressed because it is too large
+ 0 - 0
src/Masuit.MyBlogs.Core/wwwroot/Scripts/apps/app.bug.min.js


Some files were not shown because too many files changed in this diff