[後端] 修改更新角色權限頁面權限api

This commit is contained in:
dev02 2023-07-25 17:49:51 +08:00
parent 61c8e79e9c
commit fd79ba4df2

View File

@ -596,20 +596,23 @@ namespace FrontendWebApi.ApiControllers
}
else
{
await backendRepository.ExecuteSql($"delete from role_auth where role_guid = '{post.SelectedRoleId}' and AuthCode like '%PF%'");
if (post.SaveCheckAuth.Count > 0)
{
foreach (var item in post.SaveCheckAuth)
{
#region
Dictionary<string, object> roleAuth = new Dictionary<string, object>();
roleAuth = new Dictionary<string, object>()
{
{ "@role_guid", post.SelectedRoleId},
{ "@AuthCode", item},
{ "@created_by", myUser.userinfo_guid}
};
{
Dictionary<string, object> roleAuth = new Dictionary<string, object>();
roleAuth = new Dictionary<string, object>()
{
{ "@role_guid", post.SelectedRoleId},
{ "@AuthCode", item},
{ "@created_by", myUser.userinfo_guid}
};
await backendRepository.AddOneByCustomTable(roleAuth, "role_auth");
await backendRepository.AddOneByCustomTable(roleAuth, "role_auth");
}
#endregion
}
}