diff --git a/api/core/app_server.go b/api/core/app_server.go index 1bdc6635..a8fa466e 100644 --- a/api/core/app_server.go +++ b/api/core/app_server.go @@ -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/") || diff --git a/api/handler/chat_role_handler.go b/api/handler/chat_role_handler.go index 19341dd3..8e685497 100644 --- a/api/handler/chat_role_handler.go +++ b/api/handler/chat_role_handler.go @@ -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 diff --git a/web/src/assets/css/chat-app.styl b/web/src/assets/css/chat-app.styl index b096c491..c3b191e6 100644 --- a/web/src/assets/css/chat-app.styl +++ b/web/src/assets/css/chat-app.styl @@ -14,12 +14,59 @@ .inner { display flex color #ffffff - padding 20px; + padding 15px; + overflow-y visible + overflow-x hidden - .left-menu { - width 160px + .list-box { + .app-item { + border 1px solid #666666 + border-radius 6px + overflow hidden + transition: all 0.3s ease; /* 添加过渡效果 */ + + .el-image { + padding 6px + + .el-image__inner { + border-radius 10px + } + } + + .title { + display flex + padding 10px + + .name { + width 100% + text-align left + font-size 16px + font-weight bold + color #47fff1 + } + + .opt { + position: relative; + top -5px + } + } + + .hello-msg { + overflow: hidden; + white-space normal + text-overflow: ellipsis; + height 60px + padding 10px + font-size 14px + color #999999 + } + + &:hover { + box-shadow: 0 0 10px rgba(71, 255, 241, 0.6); /* 添加阴影效果 */ + transform: translateY(-10px); /* 向上移动10像素 */ + } + } } - } } \ No newline at end of file diff --git a/web/src/assets/css/task-list.css b/web/src/assets/css/task-list.css index 108f04fc..f892fbed 100644 --- a/web/src/assets/css/task-list.css +++ b/web/src/assets/css/task-list.css @@ -1,96 +1,115 @@ .task-list-box { - width: 100%; - padding: 10px; - color: #fff; - overflow-x: hidden; + width: 100%; + padding: 10px; + color: #fff; + overflow-x: hidden; } + .task-list-box .running-job-list .job-item { - width: 100%; - padding: 2px; - background-color: #555; + width: 100%; + padding: 2px; + background-color: #555; } + .task-list-box .running-job-list .job-item .job-item-inner { - position: relative; - height: 100%; - overflow: hidden; + position: relative; + height: 100%; + overflow: hidden; } + .task-list-box .running-job-list .job-item .job-item-inner .progress { - position: absolute; - width: 100%; - height: 100%; - top: 0; - left: 0; - display: flex; - justify-content: center; - align-items: center; + position: absolute; + width: 100%; + height: 100%; + top: 0; + left: 0; + display: flex; + justify-content: center; + align-items: center; } + .task-list-box .running-job-list .job-item .job-item-inner .progress span { - font-size: 20px; - color: #fff; + font-size: 20px; + color: #fff; } + .task-list-box .finish-job-list .job-item { - width: 100%; - height: 100%; + width: 100%; + height: 100%; } + .task-list-box .finish-job-list .job-item .opt .opt-line { - margin: 6px 0; + margin: 6px 0; } + .task-list-box .finish-job-list .job-item .opt .opt-line ul { - display: flex; - flex-flow: row; + display: flex; + flex-flow: row; } + .task-list-box .finish-job-list .job-item .opt .opt-line ul li { - margin-right: 10px; + margin-right: 10px; } + .task-list-box .finish-job-list .job-item .opt .opt-line ul li a { - padding: 3px 0; - width: 44px; - text-align: center; - border-radius: 5px; - display: block; - cursor: pointer; - background-color: #4e5058; - color: #fff; + padding: 3px 0; + width: 44px; + text-align: center; + border-radius: 5px; + display: block; + cursor: pointer; + background-color: #4e5058; + color: #fff; } + .task-list-box .finish-job-list .job-item .opt .opt-line ul li a:hover { - background-color: #6d6f78; + background-color: #6d6f78; } + .task-list-box .finish-job-list .job-item .opt .opt-line ul .show-prompt { - font-size: 20px; - cursor: pointer; + font-size: 20px; + cursor: pointer; } + .task-list-box .el-image { - width: 100%; - height: 100%; - max-height: 240px; + width: 100%; + height: 100%; + max-height: 240px; } + .task-list-box .el-image img { - height: 240px; + height: 240px; } + .task-list-box .el-image .el-image-viewer__wrapper img { - width: auto; - height: auto; + width: auto; + height: auto; } + .task-list-box .el-image .image-slot { - display: flex; - flex-flow: column; - justify-content: center; - align-items: center; - height: 100%; - min-height: 200px; - color: #fff; + display: flex; + flex-flow: column; + justify-content: center; + align-items: center; + height: 100%; + min-height: 200px; + color: #fff; } + .task-list-box .el-image .image-slot .iconfont { - font-size: 50px; - margin-bottom: 10px; + font-size: 50px; + margin-bottom: 10px; } + .task-list-box .el-image.upscale { - max-height: 304px; + max-height: 312px; } + .task-list-box .el-image.upscale img { - height: 304px; + height: 312px; } + .task-list-box .el-image.upscale .el-image-viewer__wrapper img { - width: auto; - height: auto; + width: auto; + height: auto; } diff --git a/web/src/assets/css/task-list.styl b/web/src/assets/css/task-list.styl index 69689420..0b5d6702 100644 --- a/web/src/assets/css/task-list.styl +++ b/web/src/assets/css/task-list.styl @@ -40,6 +40,10 @@ .job-item { width 100% height 100% + border 1px solid #666666 + padding 6px + overflow hidden + border-radius 6px .opt { .opt-line { @@ -54,7 +58,7 @@ a { padding 3px 0 - width 44px + width 40px text-align center border-radius 5px display block @@ -113,10 +117,10 @@ } .el-image.upscale { - max-height 304px + max-height 310px img { - height 304px + height 310px } .el-image-viewer__wrapper { diff --git a/web/src/components/ItemList.vue b/web/src/components/ItemList.vue index 1228f65f..551f1b8a 100644 --- a/web/src/components/ItemList.vue +++ b/web/src/components/ItemList.vue @@ -5,11 +5,11 @@ class="list-item" v-for="(item, index) in items" :key="index" - :style="{width:itemWidth + 'px', marginBottom: margin*2+'px'}" + :style="{width:itemWidth + 'px'}" > -