mirror of
				https://github.com/yangjian102621/geekai.git
				synced 2025-11-04 16:23:42 +08:00 
			
		
		
		
	return at least one chat role for getUserRoles API
This commit is contained in:
		@@ -269,7 +269,7 @@ func (h *UserHandler) Remove(c *gin.Context) {
 | 
				
			|||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
		resp.ERROR(c, "删除失败")
 | 
							resp.ERROR(c, err.Error())
 | 
				
			||||||
		tx.Rollback()
 | 
							tx.Rollback()
 | 
				
			||||||
		return
 | 
							return
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -69,7 +69,10 @@ func (h *ChatRoleHandler) ListByUser(c *gin.Context) {
 | 
				
			|||||||
			resp.ERROR(c, "角色解析失败!")
 | 
								resp.ERROR(c, "角色解析失败!")
 | 
				
			||||||
			return
 | 
								return
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		session = session.Where("marker IN ?", roleKeys)
 | 
							// 保证用户至少有一个角色可用
 | 
				
			||||||
 | 
							if len(roleKeys) > 0 {
 | 
				
			||||||
 | 
								session = session.Where("marker IN ?", roleKeys)
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if id > 0 {
 | 
						if id > 0 {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user