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 { ///