From 226ba771f0a013a5c7f1fdc7a740bdbf4e43d445 Mon Sep 17 00:00:00 2001 From: Marvin Date: Tue, 21 Dec 2021 15:32:12 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=BF=AE=E6=94=B9=E7=B3=BB=E7=BB=9F=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E8=87=AA=E5=8A=A8=E6=A0=B9=E6=8D=AE=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E5=AF=B9=E5=BA=94=E7=9A=84=E6=9D=83=E9=99=90?= =?UTF-8?q?=E8=8F=9C=E5=8D=95=202.=E4=BF=AE=E6=94=B9MAC=E8=B5=84=E6=96=99?= =?UTF-8?q?=E7=BB=B4=E6=8A=A4KCS001=E7=9A=84=E5=BC=B9=E7=AA=97=E9=AB=98?= =?UTF-8?q?=E5=BA=A6640=203.=E4=BF=AE=E6=AD=A3WebApi=E4=B8=80=E4=B8=AAAttr?= =?UTF-8?q?ibute=E5=86=B2=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/HomeController.cs | 46 +++- .../Views/Home/Framework.cshtml | 233 +----------------- AMESCoreStudio.Web/Views/KCS/KCS001.cshtml | 4 +- .../Attribute/BarCodeAttribute.cs | 2 +- .../Models/AMES/WipBarcode.cs | 2 +- AMESCoreStudio.WebApi/Models/SYS/DeptInfo.cs | 1 - 6 files changed, 50 insertions(+), 238 deletions(-) diff --git a/AMESCoreStudio.Web/Controllers/HomeController.cs b/AMESCoreStudio.Web/Controllers/HomeController.cs index 699d31c2..885bb965 100644 --- a/AMESCoreStudio.Web/Controllers/HomeController.cs +++ b/AMESCoreStudio.Web/Controllers/HomeController.cs @@ -15,11 +15,13 @@ namespace AMESCoreStudio.Web.Controllers { private readonly ILogger _logger; public readonly IAuth _authApi; + public readonly ISYS _sysApi; - public HomeController(ILogger logger, IAuth authApi) + public HomeController(ILogger logger, IAuth authApi, ISYS sysApi) { _logger = logger; _authApi = authApi; + _sysApi = sysApi; } public IActionResult Index() @@ -43,6 +45,48 @@ namespace AMESCoreStudio.Web.Controllers { if (int.Parse(userID.ToString()) >= 0) { + int user_id = int.Parse(userID.ToString()); + var userRole = await _sysApi.GetUserRolesByUser(user_id); + int role_id = userRole[0].RoleID; + + var userModule = await _sysApi.GetRoleModulesByRole(role_id, 0, 10); + var userProgram = await _sysApi.GetRoleProgramsByRole(role_id, 0, 10); + + string menuData = ""; + + ViewData["MenuList"] = menuData; + return View(); } } diff --git a/AMESCoreStudio.Web/Views/Home/Framework.cshtml b/AMESCoreStudio.Web/Views/Home/Framework.cshtml index 829afc00..ed185504 100644 --- a/AMESCoreStudio.Web/Views/Home/Framework.cshtml +++ b/AMESCoreStudio.Web/Views/Home/Framework.cshtml @@ -78,238 +78,7 @@
- + @Html.Raw(ViewData["MenuList"])
diff --git a/AMESCoreStudio.Web/Views/KCS/KCS001.cshtml b/AMESCoreStudio.Web/Views/KCS/KCS001.cshtml index ea8e96fd..2d5c2f3f 100644 --- a/AMESCoreStudio.Web/Views/KCS/KCS001.cshtml +++ b/AMESCoreStudio.Web/Views/KCS/KCS001.cshtml @@ -71,7 +71,7 @@ //通过行tool编辑,lay-event="edit" function edit(obj) { if (obj.data.class) { - hg.open('修改MAC資料', '/KCS/KCS001U/' + obj.data.class + ',' + obj.data.classGroup, 640, 820); + hg.open('修改MAC資料', '/KCS/KCS001U/' + obj.data.class + ',' + obj.data.classGroup, 640, 640); } } @@ -104,7 +104,7 @@ layuiicon: '', class: 'layui-btn-normal', handler: function () { - hg.open('新增MAC資料', '/KCS/KCS001C', 640, 860); + hg.open('新增MAC資料', '/KCS/KCS001C', 640, 640); } } diff --git a/AMESCoreStudio.WebApi/Attribute/BarCodeAttribute.cs b/AMESCoreStudio.WebApi/Attribute/BarCodeAttribute.cs index 4bfb4271..9a602158 100644 --- a/AMESCoreStudio.WebApi/Attribute/BarCodeAttribute.cs +++ b/AMESCoreStudio.WebApi/Attribute/BarCodeAttribute.cs @@ -5,7 +5,7 @@ using System.Threading.Tasks; using System.ComponentModel.DataAnnotations; using AMESCoreStudio.WebApi.Models.AMES; -namespace AMESCoreStudio.WebApi.Attribute +namespace AMESCoreStudio.WebApi { public class BarCodeAttribute : ValidationAttribute { diff --git a/AMESCoreStudio.WebApi/Models/AMES/WipBarcode.cs b/AMESCoreStudio.WebApi/Models/AMES/WipBarcode.cs index 9e258c5b..029a920b 100644 --- a/AMESCoreStudio.WebApi/Models/AMES/WipBarcode.cs +++ b/AMESCoreStudio.WebApi/Models/AMES/WipBarcode.cs @@ -2,7 +2,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Runtime.Serialization; -using AMESCoreStudio.WebApi.Attribute; +using AMESCoreStudio.WebApi; namespace AMESCoreStudio.WebApi.Models.AMES { diff --git a/AMESCoreStudio.WebApi/Models/SYS/DeptInfo.cs b/AMESCoreStudio.WebApi/Models/SYS/DeptInfo.cs index 0c4f9ca1..e0b5e2c9 100644 --- a/AMESCoreStudio.WebApi/Models/SYS/DeptInfo.cs +++ b/AMESCoreStudio.WebApi/Models/SYS/DeptInfo.cs @@ -3,7 +3,6 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Runtime.Serialization; - namespace AMESCoreStudio.WebApi.Models.SYS { ///