Bladeren bron

角色权限调整

zhengbingbing 5 jaren geleden
bovenliggende
commit
aaaba8628a

+ 2 - 1
代码/System.Common/Repositories/BaseRepository.cs

@@ -137,7 +137,8 @@ namespace System.Common
137 137
         /// <returns></returns>
138 138
         public async Task<bool> AddMany(List<T> objlist)
139 139
         {
140
-            return await Db.Insertable<T>(objlist).ExecuteCommandIdentityIntoEntityAsync();
140
+            var res = await Db.Insertable<T>(objlist).ExecuteCommandAsync();
141
+            return res > 0;
141 142
         }
142 143
 
143 144
         /// <summary>

+ 3 - 3
代码/TVShoppingCallCenter_ZLJ/Controllers/System/RoleFunctionController.cs

@@ -37,7 +37,7 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.System
37 37
         [HttpPost("saverolefunction")]
38 38
         public async Task<IActionResult> SaveRoleFunctionAsync(string[] ids, int role_id)
39 39
         {
40
-            if (ids == null)
40
+            if (ids.Length <= 0 || ids == null)
41 41
                 return Error("参数错误");
42 42
             var list_model = new List<T_Sys_RoleFunction>();
43 43
 
@@ -54,8 +54,8 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.System
54 54
                 list_model.Add(model);
55 55
 
56 56
             }
57
-
58
-            if (await _sys_role_functionRepository.AddMany(list_model))
57
+            var res = await _sys_role_functionRepository.AddMany(list_model);
58
+            if (res)
59 59
             {
60 60
                 return Success("权限设置成功!");
61 61
             }