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

@@ -145,7 +145,10 @@ func authorizeMiddleware(s *AppServer, client *redis.Client) gin.HandlerFunc {
c.Request.URL.Path == "/api/mj/notify" ||
c.Request.URL.Path == "/api/chat/history" ||
c.Request.URL.Path == "/api/chat/detail" ||
c.Request.URL.Path == "/api/role/list" ||
c.Request.URL.Path == "/api/mj/jobs" ||
c.Request.URL.Path == "/api/mj/proxy" ||
c.Request.URL.Path == "/api/sd/jobs" ||
strings.HasPrefix(c.Request.URL.Path, "/api/sms/") ||
strings.HasPrefix(c.Request.URL.Path, "/api/captcha/") ||
strings.HasPrefix(c.Request.URL.Path, "/static/") ||

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