From fd79ba4df2e916fd8459f98598ff741a04d56170 Mon Sep 17 00:00:00 2001 From: dev02 Date: Tue, 25 Jul 2023 17:49:51 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=BE=8C=E7=AB=AF]=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E8=A7=92=E8=89=B2=E6=AC=8A=E9=99=90=E9=A0=81?= =?UTF-8?q?=E9=9D=A2=E6=AC=8A=E9=99=90api?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ApiControllers/UserController.cs | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/FrontendWebApi/ApiControllers/UserController.cs b/FrontendWebApi/ApiControllers/UserController.cs index 16b3b60..e129888 100644 --- a/FrontendWebApi/ApiControllers/UserController.cs +++ b/FrontendWebApi/ApiControllers/UserController.cs @@ -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 roleAuth = new Dictionary(); - roleAuth = new Dictionary() - { - { "@role_guid", post.SelectedRoleId}, - { "@AuthCode", item}, - { "@created_by", myUser.userinfo_guid} - }; + { + Dictionary roleAuth = new Dictionary(); + roleAuth = new Dictionary() + { + { "@role_guid", post.SelectedRoleId}, + { "@AuthCode", item}, + { "@created_by", myUser.userinfo_guid} + }; - await backendRepository.AddOneByCustomTable(roleAuth, "role_auth"); + await backendRepository.AddOneByCustomTable(roleAuth, "role_auth"); + } #endregion } }