[後端] 修改更新使用者設備api
This commit is contained in:
		
							parent
							
								
									7c86b10f66
								
							
						
					
					
						commit
						7e5a8a7426
					
				@ -595,6 +595,8 @@ namespace FrontendWebApi.ApiControllers
 | 
			
		||||
                    return apiResult;
 | 
			
		||||
                }
 | 
			
		||||
                else
 | 
			
		||||
                {
 | 
			
		||||
                    if (post.Type.Equals("1"))
 | 
			
		||||
                    {
 | 
			
		||||
                        await backendRepository.ExecuteSql($"delete from role_auth where role_guid = '{post.SelectedRoleId}' and AuthCode like '%PF%'");
 | 
			
		||||
                        if (post.SaveCheckAuth.Count > 0)
 | 
			
		||||
@ -616,6 +618,31 @@ namespace FrontendWebApi.ApiControllers
 | 
			
		||||
                                #endregion
 | 
			
		||||
                            }
 | 
			
		||||
                        }
 | 
			
		||||
                    }
 | 
			
		||||
                    else if (post.Type.Equals("2"))
 | 
			
		||||
                    {
 | 
			
		||||
                        await backendRepository.ExecuteSql($"delete from role_auth where role_guid = '{post.SelectedRoleId}' and AuthCode like 'F%'");
 | 
			
		||||
                        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}
 | 
			
		||||
                                        };
 | 
			
		||||
 | 
			
		||||
                                    await backendRepository.AddOneByCustomTable(roleAuth, "role_auth");
 | 
			
		||||
                                }
 | 
			
		||||
                                #endregion
 | 
			
		||||
                            }
 | 
			
		||||
                        }
 | 
			
		||||
                    }
 | 
			
		||||
 | 
			
		||||
                    apiResult.Code = "0000";
 | 
			
		||||
                    apiResult.Msg = "儲存成功";
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
@ -147,6 +147,7 @@ namespace FrontendWebApi.Models
 | 
			
		||||
    {
 | 
			
		||||
        public string SelectedRoleId { get; set; }
 | 
			
		||||
        public List<string> SaveCheckAuth { get; set; }
 | 
			
		||||
        public string Type { get; set; }
 | 
			
		||||
        //public FrontEndCheckAuth BackEndCheckAuth { get; set; }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user