Pārlūkot izejas kodu

防火墙规则优化

懒得勤快 2 gadi atpakaļ
vecāks
revīzija
7b6daf40f1

+ 5 - 3
src/Masuit.MyBlogs.Core/Common/CommonHelper.cs

@@ -136,7 +136,8 @@ namespace Masuit.MyBlogs.Core.Common
         /// <returns></returns>
         public static async Task<bool> IsProxy(this IPAddress ip, CancellationToken cancellationToken = default)
         {
-            var httpClient = Startup.ServiceProvider.GetRequiredService<IHttpClientFactory>().CreateClient();
+            using var serviceScope = Startup.ServiceProvider.CreateScope();
+            var httpClient = serviceScope.ServiceProvider.GetRequiredService<IHttpClientFactory>().CreateClient();
             httpClient.DefaultRequestHeaders.UserAgent.ParseAdd("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.107 Safari/537.36 Edg/92.0.902.62");
             return await httpClient.GetStringAsync("https://ipinfo.io/" + ip, cancellationToken).ContinueWith(t =>
             {
@@ -250,8 +251,9 @@ namespace Masuit.MyBlogs.Core.Common
         [AutomaticRetry(Attempts = 1, OnAttemptsExceeded = AttemptsExceededAction.Delete)]
         public static void SendMail(string title, string content, string tos, string clientip)
         {
-            Startup.ServiceProvider.GetRequiredService<IMailSender>().Send(title, content, tos);
-            var redisClient = Startup.ServiceProvider.GetRequiredService<IRedisClient>();
+            using var serviceScope = Startup.ServiceProvider.CreateScope();
+            serviceScope.ServiceProvider.GetRequiredService<IMailSender>().Send(title, content, tos);
+            var redisClient = serviceScope.ServiceProvider.GetRequiredService<IRedisClient>();
             redisClient.SAdd($"Email:{DateTime.Now:yyyyMMdd}", new { title, content, tos, time = DateTime.Now, clientip });
             redisClient.Expire($"Email:{DateTime.Now:yyyyMMdd}", 86400);
         }

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

@@ -243,7 +243,17 @@ public class AdvertisementController : BaseController
 			Date = g.Key,
 			Count = g.Count()
 		}).OrderBy(a => a.Date).ToListAsync(cancellationToken);
-		return Ok(new[] { list });
+		var min = list.Min(a => a.Date);
+		var max = list.Max(a => a.Date);
+		for (var i = min; i < max; i = i.AddDays(1))
+		{
+			if (list.All(a => a.Date != i))
+			{
+				list.Add(new { Date = i, Count = 0 });
+			}
+		}
+
+		return Ok(new[] { list.OrderBy(a => a.Date) });
 	}
 
 	/// <summary>
@@ -298,7 +308,17 @@ public class AdvertisementController : BaseController
 			Date = g.Key,
 			Count = g.Count()
 		}).OrderBy(a => a.Date).ToListAsync(cancellationToken);
-		return Ok(new[] { list });
+		var min = list.Min(a => a.Date);
+		var max = list.Max(a => a.Date);
+		for (var i = min; i < max; i = i.AddDays(1))
+		{
+			if (list.All(a => a.Date != i))
+			{
+				list.Add(new { Date = i, Count = 0 });
+			}
+		}
+
+		return Ok(new[] { list.OrderBy(a => a.Date) });
 	}
 
 	/// <summary>

+ 3 - 2
src/Masuit.MyBlogs.Core/Controllers/DefaultController.cs

@@ -1,4 +1,5 @@
-using Masuit.Tools.AspNetCore.ModelBinder;
+using Masuit.MyBlogs.Core.Extensions.Firewall;
+using Masuit.Tools.AspNetCore.ModelBinder;
 using Microsoft.AspNetCore.Mvc;
 
 namespace Masuit.MyBlogs.Core.Controllers;
@@ -10,7 +11,7 @@ public class DefaultController : Controller
     /// </summary>
     /// <param name="pair"></param>
     /// <returns></returns>
-    [HttpPost("/SetCookie"), HttpGet("/SetCookie")]
+    [HttpPost("/SetCookie"), HttpGet("/SetCookie"), AllowAccessFirewall]
     public ActionResult SetCookie([FromBodyOrDefault] NameValuePair pair)
     {
         Response.Cookies.Append(pair.Name, pair.Value, new CookieOptions

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

@@ -191,12 +191,12 @@ namespace Masuit.MyBlogs.Core.Controllers
                 case "copy":
                     if (!string.IsNullOrEmpty(req.Item))
                     {
-                        System.IO.File.Copy(Path.Combine(root, req.Item.TrimStart('\\', '/')), Path.Combine(root, req.NewItemPath.TrimStart('\\', '/')));
+                        System.IO.File.Copy(Path.Combine(root, req.Item.TrimStart('\\', '/')), Path.Combine(root, req.NewItemPath.TrimStart('\\', '/')), true);
                     }
                     else
                     {
                         newpath = Path.Combine(root, req.NewPath.TrimStart('\\', '/'));
-                        req.Items.ForEach(s => System.IO.File.Copy(Path.Combine(root, s.TrimStart('\\', '/')), !string.IsNullOrEmpty(req.SingleFilename) ? Path.Combine(newpath, req.SingleFilename) : Path.Combine(newpath, Path.GetFileName(s))));
+                        req.Items.ForEach(s => System.IO.File.Copy(Path.Combine(root, s.TrimStart('\\', '/')), !string.IsNullOrEmpty(req.SingleFilename) ? Path.Combine(newpath, req.SingleFilename) : Path.Combine(newpath, Path.GetFileName(s)), true));
                     }
                     list.Add(new
                     {

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

@@ -1,5 +1,6 @@
 using Masuit.MyBlogs.Core.Common;
 using Masuit.MyBlogs.Core.Extensions;
+using Masuit.MyBlogs.Core.Extensions.Firewall;
 using Masuit.MyBlogs.Core.Models.DTO;
 using Masuit.MyBlogs.Core.Models.Entity;
 using Masuit.MyBlogs.Core.Models.Enum;
@@ -19,14 +20,13 @@ namespace Masuit.MyBlogs.Core.Controllers
     {
         public IHttpClientFactory HttpClientFactory { get; set; }
         public IConfiguration Configuration { get; set; }
-
         private HttpClient HttpClient => HttpClientFactory.CreateClient();
 
         /// <summary>
         /// 友情链接页
         /// </summary>
         /// <returns></returns>
-        [Route("links"), ResponseCache(Duration = 600, VaryByHeader = "Cookie")]
+        [Route("links"), ResponseCache(Duration = 600, VaryByHeader = "Cookie"), AllowAccessFirewall]
         public async Task<ActionResult> Index([FromServices] IWebHostEnvironment hostEnvironment)
         {
             var list = LinksService.GetQueryFromCache<bool, LinksDto>(l => l.Status == Status.Available, l => l.Recommend, false);

+ 4 - 3
src/Masuit.MyBlogs.Core/Controllers/NoticeController.cs

@@ -1,5 +1,6 @@
 using Masuit.MyBlogs.Core.Common;
 using Masuit.MyBlogs.Core.Extensions;
+using Masuit.MyBlogs.Core.Extensions.Firewall;
 using Masuit.MyBlogs.Core.Infrastructure.Services.Interface;
 using Masuit.MyBlogs.Core.Models;
 using Masuit.MyBlogs.Core.Models.DTO;
@@ -32,7 +33,7 @@ namespace Masuit.MyBlogs.Core.Controllers
         /// <param name="page"></param>
         /// <param name="size"></param>
         /// <returns></returns>
-        [Route("notice"), Route("n", Order = 1), ResponseCache(Duration = 600, VaryByQueryKeys = new[] { "page", "size" }, VaryByHeader = "Cookie")]
+        [Route("notice"), AllowAccessFirewall, Route("n", Order = 1), ResponseCache(Duration = 600, VaryByQueryKeys = new[] { "page", "size" }, VaryByHeader = "Cookie")]
         public ActionResult Index([Range(1, int.MaxValue, ErrorMessage = "页码必须大于0")] int page = 1, [Range(1, 50, ErrorMessage = "页大小必须在0到50之间")] int size = 15)
         {
             var list = NoticeService.GetPagesFromCache<DateTime, NoticeDto>(page, size, n => n.NoticeStatus == NoticeStatus.Normal, n => n.ModifyDate, false);
@@ -53,7 +54,7 @@ namespace Masuit.MyBlogs.Core.Controllers
         /// </summary>
         /// <param name="id"></param>
         /// <returns></returns>
-        [Route("notice/{id:int}"), ResponseCache(Duration = 600, VaryByQueryKeys = new[] { "id" }, VaryByHeader = "Cookie")]
+        [Route("notice/{id:int}"), AllowAccessFirewall, ResponseCache(Duration = 600, VaryByQueryKeys = new[] { "id" }, VaryByHeader = "Cookie")]
         public async Task<ActionResult> Details(int id)
         {
             var notice = await NoticeService.GetByIdAsync(id) ?? throw new NotFoundException("页面未找到");
@@ -194,7 +195,7 @@ namespace Masuit.MyBlogs.Core.Controllers
         /// 最近一条公告
         /// </summary>
         /// <returns></returns>
-        [ResponseCache(Duration = 600, VaryByHeader = "Cookie")]
+        [ResponseCache(Duration = 600, VaryByHeader = "Cookie"), AllowAccessFirewall]
         public async Task<ActionResult> Last()
         {
             var notice = await NoticeService.GetAsync(n => n.NoticeStatus == NoticeStatus.Normal, n => n.ModifyDate, false);

+ 32 - 8
src/Masuit.MyBlogs.Core/Controllers/PostController.cs

@@ -632,8 +632,8 @@ public class PostController : BaseController
 	[MyAuthorize]
 	public ActionResult Get(int id)
 	{
-		Post post = PostService[id] ?? throw new NotFoundException("文章未找到");
-		PostDto model = post.Mapper<PostDto>();
+		var post = PostService.GetQuery(e => e.Id == id).Include(e => e.Seminar).FirstOrDefault() ?? throw new NotFoundException("文章未找到");
+		var model = post.Mapper<PostDto>();
 		model.Seminars = post.Seminar.Select(s => s.Id).Join(",");
 		return ResultData(model);
 	}
@@ -1012,13 +1012,17 @@ public class PostController : BaseController
 	/// <param name="id"></param>
 	/// <param name="sids"></param>
 	/// <returns></returns>
-	[HttpPost("post/{id}/ChangeSeminar/{sids}")]
+	[HttpPost("post/{id}/ChangeSeminar")]
 	public async Task<ActionResult> ChangeSeminar(int id, string sids)
 	{
-		var post = PostService[id] ?? throw new NotFoundException("文章不存在");
-		var ids = sids.Split(',', StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToArray();
+		var post = PostService.GetQuery(e => e.Id == id).Include(e => e.Seminar).FirstOrDefault() ?? throw new NotFoundException("文章不存在");
 		post.Seminar.Clear();
-		post.Seminar.AddRange(SeminarService[s => ids.Contains(s.Id)]);
+		if (!string.IsNullOrEmpty(sids))
+		{
+			var ids = sids.Split(',', StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToArray();
+			post.Seminar.AddRange(SeminarService[s => ids.Contains(s.Id)]);
+		}
+
 		await PostService.SaveChangesAsync();
 		return Ok();
 	}
@@ -1219,7 +1223,17 @@ public class PostController : BaseController
 			Count = g.Sum(t => t.Count),
 			UV = g.Sum(t => t.UV)
 		}).OrderBy(a => a.Date).ToListAsync(cancellationToken);
-		return Ok(new[] { list });
+		var min = list.Min(a => a.Date);
+		var max = list.Max(a => a.Date);
+		for (var i = min; i < max; i = i.AddDays(1))
+		{
+			if (list.All(a => a.Date != i))
+			{
+				list.Add(new { Date = i, Count = 0, UV = 0 });
+			}
+		}
+
+		return Ok(new[] { list.OrderBy(a => a.Date) });
 	}
 
 	/// <summary>
@@ -1276,7 +1290,17 @@ public class PostController : BaseController
 			Count = g.Count(),
 			UV = g.Select(e => e.IP).Distinct().Count()
 		}).OrderBy(a => a.Date).ToListAsync(cancellationToken);
-		return Ok(new[] { list });
+		var min = list.Min(a => a.Date);
+		var max = list.Max(a => a.Date);
+		for (var i = min; i < max; i = i.AddDays(1))
+		{
+			if (list.All(a => a.Date != i))
+			{
+				list.Add(new { Date = i, Count = 0, UV = 0 });
+			}
+		}
+
+		return Ok(new[] { list.OrderBy(a => a.Date) });
 	}
 
 	/// <summary>

+ 3 - 2
src/Masuit.MyBlogs.Core/Controllers/ShortController.cs

@@ -1,5 +1,6 @@
 using FreeRedis;
 using Masuit.MyBlogs.Core.Extensions;
+using Masuit.MyBlogs.Core.Extensions.Firewall;
 using Masuit.Tools;
 using Microsoft.AspNetCore.Mvc;
 
@@ -8,7 +9,7 @@ namespace Masuit.MyBlogs.Core.Controllers
     public class ShortController : Controller
     {
         public IRedisClient RedisHelper { get; set; }
-        [HttpGet("short"), MyAuthorize]
+        [HttpGet("short"), MyAuthorize, AllowAccessFirewall]
         public IActionResult Short(string key, string url, int? expire)
         {
             expire ??= -1;
@@ -17,7 +18,7 @@ namespace Masuit.MyBlogs.Core.Controllers
             return Ok(id);
         }
 
-        [HttpGet("{key}", Order = 100)]
+        [HttpGet("{key}", Order = 100), AllowAccessFirewall]
         public ActionResult RedirectTo(string key)
         {
             var url = RedisHelper.Get("shorturl:" + key) ?? throw new NotFoundException("链接未找到");

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

@@ -9,124 +9,125 @@ using System.Text.RegularExpressions;
 
 namespace Masuit.MyBlogs.Core.Extensions.UEditor
 {
-    /// <summary>
-    /// Crawler 的摘要说明
-    /// </summary>
-    public class CrawlerHandler : Handler
-    {
-        private readonly HttpClient _httpClient;
-        private readonly IConfiguration _configuration;
+	/// <summary>
+	/// Crawler 的摘要说明
+	/// </summary>
+	public class CrawlerHandler : Handler
+	{
+		private readonly HttpClient _httpClient;
+		private readonly IConfiguration _configuration;
 
-        public CrawlerHandler(HttpContext context) : base(context)
-        {
-            _httpClient = context.RequestServices.GetRequiredService<IHttpClientFactory>().CreateClient();
-            _configuration = context.RequestServices.GetRequiredService<IConfiguration>();
-        }
+		public CrawlerHandler(HttpContext context) : base(context)
+		{
+			_httpClient = context.RequestServices.GetRequiredService<IHttpClientFactory>().CreateClient();
+			_configuration = context.RequestServices.GetRequiredService<IConfiguration>();
+		}
 
-        public override async Task<string> Process()
-        {
-            var form = await Request.ReadFormAsync();
-            string[] sources = form["source[]"];
-            if (sources?.Length > 0 || sources?.Length <= 10)
-            {
-                using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(30));
-                return WriteJson(new
-                {
-                    state = "SUCCESS",
-                    list = (await sources.SelectAsync(s =>
-                    {
-                        return new Crawler(s, _httpClient, _configuration).Fetch(cts.Token).ContinueWith(t => new
-                        {
-                            state = t.Result.State,
-                            source = t.Result.SourceUrl,
-                            url = t.Result.ServerUrl
-                        });
-                    }))
-                });
-            }
+		public override async Task<string> Process()
+		{
+			var form = await Request.ReadFormAsync();
+			string[] sources = form["source[]"];
+			if (sources?.Length > 0 || sources?.Length <= 10)
+			{
+				using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(30));
+				return WriteJson(new
+				{
+					state = "SUCCESS",
+					list = (await sources.SelectAsync(s =>
+					{
+						return new Crawler(s, _httpClient, _configuration, Context).Fetch(cts.Token).ContinueWith(t => new
+						{
+							state = t.Result.State,
+							source = t.Result.SourceUrl,
+							url = t.Result.ServerUrl
+						});
+					}))
+				});
+			}
 
-            return WriteJson(new
-            {
-                state = "参数错误:没有指定抓取源"
-            });
-        }
-    }
+			return WriteJson(new
+			{
+				state = "参数错误:没有指定抓取源"
+			});
+		}
+	}
 
-    public class Crawler
-    {
-        public string SourceUrl { get; set; }
+	public class Crawler
+	{
+		public string SourceUrl { get; set; }
 
-        public string ServerUrl { get; set; }
+		public string ServerUrl { get; set; }
 
-        public string State { get; set; }
+		public string State { get; set; }
 
-        private readonly HttpClient _httpClient;
-        private readonly IConfiguration _configuration;
+		private readonly HttpClient _httpClient;
+		private readonly IConfiguration _configuration;
+		private readonly HttpContext _httpContext;
+		public Crawler(string sourceUrl, HttpClient httpClient, IConfiguration configuration, HttpContext httpContext)
+		{
+			SourceUrl = sourceUrl;
+			_httpClient = httpClient;
+			_configuration = configuration;
+			_httpContext = httpContext;
+		}
 
-        public Crawler(string sourceUrl, HttpClient httpClient, IConfiguration configuration)
-        {
-            SourceUrl = sourceUrl;
-            _httpClient = httpClient;
-            _configuration = configuration;
-        }
+		public async Task<Crawler> Fetch(CancellationToken token)
+		{
+			if (!SourceUrl.IsExternalAddress())
+			{
+				State = "INVALID_URL";
+				return this;
+			}
+			try
+			{
+				_httpClient.DefaultRequestHeaders.Referrer = new Uri(SourceUrl);
+				using var response = await _httpClient.GetAsync(_configuration["HttpClientProxy:UriPrefix"] + SourceUrl);
+				if (response.StatusCode != HttpStatusCode.OK)
+				{
+					State = "远程地址返回了错误的状态吗:" + response.StatusCode;
+					return this;
+				}
 
-        public async Task<Crawler> Fetch(CancellationToken token)
-        {
-            if (!SourceUrl.IsExternalAddress())
-            {
-                State = "INVALID_URL";
-                return this;
-            }
-            try
-            {
-                _httpClient.DefaultRequestHeaders.Referrer = new Uri(SourceUrl);
-                using var response = await _httpClient.GetAsync(_configuration["HttpClientProxy:UriPrefix"] + SourceUrl);
-                if (response.StatusCode != HttpStatusCode.OK)
-                {
-                    State = "远程地址返回了错误的状态吗:" + response.StatusCode;
-                    return this;
-                }
+				ServerUrl = PathFormatter.Format(Path.GetFileNameWithoutExtension(SourceUrl), CommonHelper.SystemSettings.GetOrAdd("UploadPath", "upload") + UeditorConfig.GetString("catcherPathFormat")) + MimeMapper.ExtTypes[response.Content.Headers.ContentType?.MediaType ?? "image/jpeg"];
+				var stream = await response.Content.ReadAsStreamAsync();
+				var format = await Image.DetectFormatAsync(stream).ContinueWith(t => t.IsCompletedSuccessfully ? t.Result : null);
+				stream.Position = 0;
+				if (format != null)
+				{
+					ServerUrl = ServerUrl.Replace(Path.GetExtension(ServerUrl), "." + format.Name.ToLower());
+					if (!Regex.IsMatch(format.Name, "JPEG|PNG|Webp|GIF", RegexOptions.IgnoreCase))
+					{
+						using var image = await Image.LoadAsync(stream);
+						var memoryStream = new MemoryStream();
+						await image.SaveAsJpegAsync(memoryStream);
+						await stream.DisposeAsync();
+						stream = memoryStream;
+						ServerUrl = ServerUrl.Replace(Path.GetExtension(ServerUrl), ".jpg");
+					}
+				}
 
-                ServerUrl = PathFormatter.Format(Path.GetFileNameWithoutExtension(SourceUrl), CommonHelper.SystemSettings.GetOrAdd("UploadPath", "upload") + UeditorConfig.GetString("catcherPathFormat")) + MimeMapper.ExtTypes[response.Content.Headers.ContentType?.MediaType ?? "image/jpeg"];
-                var stream = await response.Content.ReadAsStreamAsync();
-                var format = await Image.DetectFormatAsync(stream).ContinueWith(t => t.IsCompletedSuccessfully ? t.Result : null);
-                stream.Position = 0;
-                if (format != null)
-                {
-                    ServerUrl = ServerUrl.Replace(Path.GetExtension(ServerUrl), "." + format.Name.ToLower());
-                    if (!Regex.IsMatch(format.Name, "JPEG|PNG|Webp|GIF", RegexOptions.IgnoreCase))
-                    {
-                        using var image = await Image.LoadAsync(stream);
-                        var memoryStream = new MemoryStream();
-                        await image.SaveAsJpegAsync(memoryStream);
-                        await stream.DisposeAsync();
-                        stream = memoryStream;
-                        ServerUrl = ServerUrl.Replace(Path.GetExtension(ServerUrl), ".jpg");
-                    }
-                }
+				var savePath = AppContext.BaseDirectory + "wwwroot" + ServerUrl;
+				var (url, success) = await _httpContext.RequestServices.GetRequiredService<ImagebedClient>().UploadImage(stream, savePath, token);
+				if (success)
+				{
+					ServerUrl = url;
+				}
+				else
+				{
+					Directory.CreateDirectory(Path.GetDirectoryName(savePath));
+					await File.WriteAllBytesAsync(savePath, await stream.ToArrayAsync());
+				}
 
-                var savePath = AppContext.BaseDirectory + "wwwroot" + ServerUrl;
-                var (url, success) = await Startup.ServiceProvider.GetRequiredService<ImagebedClient>().UploadImage(stream, savePath, token);
-                if (success)
-                {
-                    ServerUrl = url;
-                }
-                else
-                {
-                    Directory.CreateDirectory(Path.GetDirectoryName(savePath));
-                    await File.WriteAllBytesAsync(savePath, await stream.ToArrayAsync());
-                }
+				await stream.DisposeAsync();
+				State = "SUCCESS";
+			}
+			catch (Exception e)
+			{
+				State = "抓取错误:" + e.Message;
+				LogManager.Error(e.Demystify());
+			}
 
-                await stream.DisposeAsync();
-                State = "SUCCESS";
-            }
-            catch (Exception e)
-            {
-                State = "抓取错误:" + e.Message;
-                LogManager.Error(e.Demystify());
-            }
-
-            return this;
-        }
-    }
+			return this;
+		}
+	}
 }

+ 1 - 1
src/Masuit.MyBlogs.Core/Extensions/UEditor/UploadHandler.cs

@@ -63,7 +63,7 @@ namespace Masuit.MyBlogs.Core.Extensions.UEditor
                     }
 
                     var localPath = AppContext.BaseDirectory + "wwwroot" + savePath;
-                    var (url, success) = await Startup.ServiceProvider.GetRequiredService<ImagebedClient>().UploadImage(stream2, localPath, cts.Token);
+                    var (url, success) = await Context.RequestServices.GetRequiredService<ImagebedClient>().UploadImage(stream2, localPath, cts.Token);
                     if (success)
                     {
                         Result.Url = url;

+ 1 - 1
src/Masuit.MyBlogs.Core/Program.cs

@@ -72,4 +72,4 @@ static void InitOneDrive()
 		Console.WriteLine("数据初始化成功");
 		Console.WriteLine($"请登录 {OneDriveConfiguration.BaseUri}/#/admin 进行身份及其他配置");
 	}
-}
+}

+ 1 - 1
src/Masuit.MyBlogs.Core/Views/Links/Index_Admin.cshtml

@@ -47,7 +47,7 @@
             allowOutsideClick: false,
             preConfirm: function () {
                 return new Promise(function (resolve) {
-                    $.post("/links/add", {
+                    $.post("/links/save", {
                         Name: $('#title').val(),
                         Url: $('#url').val(),
                         UrlBase: $('#urlbase').val()

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

@@ -180,7 +180,7 @@
                             for (var i = 0; i < data.arr.length; i++) {
                                 arr.push(data.arr[i].Id);
                             }
-                            $http.post(`/post/${item.Id}/ChangeSeminar/${arr.join(",")}`).then(function (res) {
+                            $http.post(`/post/${item.Id}/ChangeSeminar?sids=${arr.join(",")}`).then(function (res) {
                                 if (data.status >= 400) {
                                     layer.msg("操作失败");
                                 }