From c42731f080a4873e298bfe8489b47993432d8404 Mon Sep 17 00:00:00 2001
From: dengjunjie <dengjunjie@hnkhzn.com>
Date: 星期五, 24 十月 2025 12:08:48 +0800
Subject: [PATCH] 优化权限配置

---
 新建文件夹/WIDESEA_WMSServer/WIDESEA_SystemService/Sys_RoleService.cs |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git "a/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/WIDESEA_SystemService/Sys_RoleService.cs" "b/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/WIDESEA_SystemService/Sys_RoleService.cs"
index fb668b1..f639c07 100644
--- "a/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/WIDESEA_SystemService/Sys_RoleService.cs"
+++ "b/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/WIDESEA_SystemService/Sys_RoleService.cs"
@@ -26,7 +26,7 @@
 
         public IRepository<Sys_Role> Repository => BaseDal;
 
-        public Sys_RoleService(IRepository<Sys_Role> BaseDal, ISys_MenuService MenuService,  IUnitOfWorkManage unitOfWorkManage, ISys_RoleAuthService roleAuthService) : base(BaseDal)
+        public Sys_RoleService(IRepository<Sys_Role> BaseDal, ISys_MenuService MenuService, IUnitOfWorkManage unitOfWorkManage, ISys_RoleAuthService roleAuthService) : base(BaseDal)
         {
             _unitOfWorkManage = unitOfWorkManage;
             _MenuService = MenuService;
@@ -187,7 +187,7 @@
                 //褰撳墠鐢ㄦ埛鐨勬潈闄�
                 List<Permissions> permissions = _MenuService.GetPermissions(App.User.RoleId);
 
-                List<int> menuIds = _MenuService.Repository.QueryData(x => x.MenuId, x => x.MenuType == 1);
+                List<int> menuIds = _MenuService.Repository.QueryData(x => x.MenuId, x => x.MenuType == 0);
 
                 List<int> originalMeunIds = new List<int>();
                 //琚垎閰嶈鑹茬殑鏉冮檺
@@ -229,9 +229,9 @@
 
                 }
                 //鏇存柊鏉冮檺
-                _RoleAuthService.Repository.UpdateData(updateAuths);
+                _RoleAuthService.Repository.UpdateData(updateAuths.Where(x => x.AuthId > 0).ToList());
                 //鏂板鐨勬潈闄�
-                _RoleAuthService.Repository.AddData(updateAuths);
+                _RoleAuthService.Repository.AddData(updateAuths.Where(x => x.AuthId <= 0).ToList());
 
                 //鑾峰彇鏉冮檺鍙栨秷鐨勬潈闄�
                 int[] authIds = roleAuths.Where(x => userPermissions.Select(u => u.Id)

--
Gitblit v1.9.3