Forráskód Böngészése

评论bug修复和菜单管理优化

懒得勤快 6 éve
szülő
commit
8ce3e2ef1e

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

@@ -20,6 +20,10 @@
     <Content Remove="bundleconfig.json" />
   </ItemGroup>
 
+  <ItemGroup>
+    <None Include="bundleconfig.json" />
+  </ItemGroup>
+
   <ItemGroup>
     <PackageReference Include="Aliyun.OSS.SDK.NetCore" Version="2.9.1" />
     <PackageReference Include="Aspose.Words" Version="18.11.0" />

+ 6 - 0
src/Masuit.MyBlogs.Core/bundleconfig.json

@@ -10,5 +10,11 @@
     "inputFiles": [
       "wwwroot/Scripts/global/article.js"
     ]
+  },
+  {
+    "outputFileName": "wwwroot/ng-views/controllers/menu.min.js",
+    "inputFiles": [
+      "wwwroot/ng-views/controllers/menu.js"
+    ]
   }
 ]

+ 7 - 5
src/Masuit.MyBlogs.Core/wwwroot/Scripts/global/article.js

@@ -139,9 +139,10 @@
 	//回复表单的提交
 	$("#reply-form").on("submit", function(e) {
 		e.preventDefault();
-		layui.layedit.sync(window.currentEditor);
+        var formData = $(this).serializeObject();
+        layui.layedit.sync(window.currentEditor);
 		loading();
-		if ($("#name2").val().trim().length <= 0 || $("#name").val().trim().length > 36) {
+		if (formData["NickName"].trim().length <= 0 ||formData["NickName"].trim().length > 36) {
 			window.notie.alert({
 				type: 3,
 				text: "亲,能留个正常点的名字不!",
@@ -150,8 +151,8 @@
 			loadingDone();
 			return;
 		}
-		if (!/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/.test($("#email2")
-			.val().trim())) {
+
+		if (!/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/.test(formData["Email"].trim())) {
 			window.notie.alert({
 				type: 3,
 				text: "请输入正确的邮箱格式!",
@@ -160,7 +161,8 @@
 			loadingDone();
 			return;
 		}
-		localStorage.setItem("user", JSON.stringify($(this).serializeObject()));
+
+		localStorage.setItem("user",  JSON.stringify(formData));
 		$.post("/comment/put", $(this).serialize(), (data) => {
 			loadingDone();
 			if (data.Success) {

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 0 - 0
src/Masuit.MyBlogs.Core/wwwroot/Scripts/global/article.min.js


+ 2 - 42
src/Masuit.MyBlogs.Core/wwwroot/ng-views/controllers/menu.js

@@ -160,28 +160,12 @@
 	};
 	$scope.menu = {};
 	$scope.newItem = function() {
-		//Custombox.open({
-		//	target: '#menu',
-		//	zIndex: 100,
-		//	height: 900,
-		//	close: function () {
-		//		$scope.menu = {};
-		//	},
-		//	overlayOpacity: 0.5
-		//});
 		layer.open({
 			type: 1,
 			zIndex: 20,
 			title: '修改菜单信息',
 			area: (window.screen.width > 600 ? 600 : window.screen.width) + 'px',// '340px'], //宽高
-			//area: ['600px', '260px'], //宽高
 			content: $("#modal"),
-			//cancel: function(index, layero) {
-			//	setTimeout(function() {
-			//		$("#modal").css("display", "none");
-			//	}, 500);
-			//	return true;
-			//},
 			success: function(layero, index) {
 				$scope.menu = {};
 			},
@@ -192,6 +176,7 @@
 		var nodeData = $scope.data[$scope.data.length - 1];
 		$scope.menu.Sort = nodeData.Sort + (nodeData.nodes.length + 1) * 10;
 		$scope.menu.ParentId  = 0;
+		$scope.menu.MenuType  = 0;
 	};
 	$scope.submenu = {};
 
@@ -202,28 +187,12 @@
 		}, 500);
 	}
 	$scope.newSubItem = function (scope) {
-		//Custombox.open({
-		//	target: '#menu',
-		//	zIndex: 100,
-		//	height: 900,
-		//	close: function () {
-		//		$scope.menu = {};
-		//	},
-		//	overlayOpacity:0.5
-		//});
 		layer.open({
 			type: 1,
 			zIndex: 20,
 			title: '修改菜单信息',
 			area: (window.screen.width > 600 ? 600 : window.screen.width) + 'px',// '340px'], //宽高
-			//area: ['600px', '270px'], //宽高
 			content: $("#modal"),
-			//cancel: function(index, layero) {
-			//	setTimeout(function() {
-			//		$("#modal").css("display", "none");
-			//	}, 500);
-			//	return true;
-			//},
 			success: function(layero, index) {
 				$scope.menu = {};
 			},
@@ -238,6 +207,7 @@
 			return false;
 		}
 		$scope.menu.Sort = (nodeData.Sort + nodeData.nodes.length + 1) * 10;
+		$scope.menu.MenuType  = nodeData.MenuType;
 		$scope.menu.ParentId = nodeData.Id;
 	};
 	$scope.expandAll = function() {
@@ -324,15 +294,6 @@
 			});
 		}else {
 			//添加
-			if (menu.ParentId == 0) {
-				//添加主菜单
-				var nodeData = $scope.data[$scope.data.length - 1];
-				menu.Sort = nodeData.Sort + (nodeData.nodes.length + 1) * 10;
-				$scope.data.push(menu);
-			} else {
-				//添加子菜单
-				$scope.submenu.nodes.push(menu);
-			}
 			$scope.request("/menu/save", menu, function (data) {
 				window.notie.alert({
 					type: 1,
@@ -341,7 +302,6 @@
 				});
 				$scope.menu = {};
 				$scope.closeAll();
-				//Custombox.close();
 				$scope.init();
 			});
 		}

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 0 - 0
src/Masuit.MyBlogs.Core/wwwroot/ng-views/controllers/menu.min.js


Nem az összes módosított fájl került megjelenítésre, mert túl sok fájl változott