From 4bcb683ccc1f26585fb25f920e20d223e21db07a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E7=82=9C=E7=BF=94?= <2307953404@qq.com> Date: Mon, 2 Dec 2024 16:31:45 +0800 Subject: [PATCH] 1 --- asg_form/Controllers/menuAssignController.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/asg_form/Controllers/menuAssignController.cs b/asg_form/Controllers/menuAssignController.cs index 8e9fc4b..bba5151 100644 --- a/asg_form/Controllers/menuAssignController.cs +++ b/asg_form/Controllers/menuAssignController.cs @@ -22,6 +22,7 @@ namespace asg_form.Controllers public string allow_operate { get; set; } public string show { get; set; } public int sort { get; set; } + public string adaptability { get; set; } } public class menuInput { @@ -35,6 +36,7 @@ namespace asg_form.Controllers public string allowOperate { get; set; } public string show { get; set; } public int sort { get; set; } + public string adaptability { get; set; } } private readonly UserManager userManager; @@ -70,7 +72,7 @@ namespace asg_form.Controllers allow_operate = msg.allowOperate, show = msg.show, sort = msg.sort, - + adaptability = msg.adaptability == null ? "1" :msg.adaptability, }; db.mainMenu.Add(menu); db.SaveChanges(); @@ -87,6 +89,7 @@ namespace asg_form.Controllers mA.allow_operate = msg.allowOperate; mA.show = msg.show; mA.sort = msg.sort; + mA.adaptability = msg.adaptability == null ? "1" : msg.adaptability; db.SaveChanges(); } return Ok(new error_mb { code = 200, message = "成功存入" }); @@ -138,6 +141,7 @@ namespace asg_form.Controllers public string allowOperate { get; set; } public string show { get; set; } public int sort { get; set; } = 1; + public string adaptability { get; set; } public List children { get; set; } = new List(); } @@ -159,6 +163,7 @@ namespace asg_form.Controllers allowOperate = x.allow_operate, show = x.show, sort = x.sort, + adaptability = x.adaptability, children = BuildTree(nodes, x.id) }).ToList(); }