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