opt: adjust ItemList component styles

This commit is contained in:
RockYang
2023-10-15 15:47:42 +08:00
parent fb3d43d2d5
commit 80e2b34abc
11 changed files with 195 additions and 105 deletions

View File

@@ -48,13 +48,15 @@ func (h *ChatRoleHandler) List(c *gin.Context) {
return
}
user, err := utils.GetLoginUser(c, h.db)
if err != nil {
userId := h.GetInt(c, "user_id", 0)
if userId == 0 {
resp.NotAuth(c)
return
}
var user model.User
h.db.First(&user, userId)
var roleKeys []string
err = utils.JsonDecode(user.ChatRoles, &roleKeys)
err := utils.JsonDecode(user.ChatRoles, &roleKeys)
if err != nil {
resp.ERROR(c, "角色解析失败!")
return