111
This commit is contained in:
		
							parent
							
								
									4effb66e28
								
							
						
					
					
						commit
						0f80456dc6
					
				@ -114,7 +114,7 @@ namespace asg_form.Controllers
 | 
				
			|||||||
            string userId = this.User.FindFirst(ClaimTypes.NameIdentifier)!.Value;
 | 
					            string userId = this.User.FindFirst(ClaimTypes.NameIdentifier)!.Value;
 | 
				
			||||||
            var user = await userManager.FindByIdAsync(userId);
 | 
					            var user = await userManager.FindByIdAsync(userId);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if (!this.User.FindAll(ClaimTypes.Role).Any(a => a.Value == "nadmin"))
 | 
					            if (!this.User.FindAll(ClaimTypes.Role).Any(a => a.Value == "nbadmin"))
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                return Ok(new error_mb { code = 401, message = "无权访问" });
 | 
					                return Ok(new error_mb { code = 401, message = "无权访问" });
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
@ -164,7 +164,7 @@ namespace asg_form.Controllers
 | 
				
			|||||||
        {
 | 
					        {
 | 
				
			||||||
            //string encodedChinaname = HttpUtility.UrlEncode(chinaname);
 | 
					            //string encodedChinaname = HttpUtility.UrlEncode(chinaname);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if (!this.User.FindAll(ClaimTypes.Role).Any(a => a.Value == "nadmin"))
 | 
					            if (!this.User.FindAll(ClaimTypes.Role).Any(a => a.Value == "nbadmin"))
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                return Ok(new error_mb { code = 401, message = "无权访问" });
 | 
					                return Ok(new error_mb { code = 401, message = "无权访问" });
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user