From 6cfc7175e88c546d7379b8e1efd1060558613e64 Mon Sep 17 00:00:00 2001 From: GeekMaster Date: Fri, 25 Jul 2025 15:31:58 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E6=9E=84=EF=BC=9A=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E8=AE=A4=E8=AF=81=E9=80=BB=E8=BE=91=E3=80=81=E7=95=8C=E9=9D=A2?= =?UTF-8?q?=E4=B8=80=E8=87=B4=E6=80=A7=E5=92=8C=E9=94=99=E8=AF=AF=E5=A4=84?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 移除聊天和音乐接口的冗余认证绕过配置 - 为聊天列表查询添加调试日志记录 - 在即梦和视频模块集成登录弹窗提升用户体验 - 修复模型属性映射问题(category->tag, description->desc) - 移除即梦生成按钮的禁用状态限制 - 简化即梦设置管理页面布局,去除标签页结构 - 清理控制台日志输出并改进错误处理一致性 --- api/core/app_server.go | 5 - api/handler/chat_item_handler.go | 3 +- web/src/store/jimeng.js | 8 +- web/src/store/video.js | 12 + web/src/views/ChatPlus.vue | 12 +- web/src/views/Home.vue | 1 - web/src/views/Jimeng.vue | 1 - web/src/views/admin/jimeng/JimengSetting.vue | 319 +++++++++---------- 8 files changed, 181 insertions(+), 180 deletions(-) diff --git a/api/core/app_server.go b/api/core/app_server.go index 626b09d6..8a1a2f2a 100644 --- a/api/core/app_server.go +++ b/api/core/app_server.go @@ -49,9 +49,6 @@ var authConfig = &AuthConfig{ "/api/admin/login": false, "/api/admin/logout": false, "/api/admin/login/captcha": false, - "/api/chat/history": false, - "/api/chat/detail": false, - "/api/chat/list": false, "/api/app/list": false, "/api/app/type/list": false, "/api/app/list/user": false, @@ -66,8 +63,6 @@ var authConfig = &AuthConfig{ "/api/markMap/client": false, "/api/payment/doPay": false, "/api/payment/payWays": false, - "/api/suno/detail": false, - "/api/suno/play": false, "/api/download": false, "/api/dall/models": false, }, diff --git a/api/handler/chat_item_handler.go b/api/handler/chat_item_handler.go index 53d95b64..fbf777cc 100644 --- a/api/handler/chat_item_handler.go +++ b/api/handler/chat_item_handler.go @@ -20,6 +20,7 @@ import ( // List 获取会话列表 func (h *ChatHandler) List(c *gin.Context) { + logger.Info(h.GetLoginUserId(c)) if !h.IsLogin(c) { resp.SUCCESS(c) return @@ -28,7 +29,7 @@ func (h *ChatHandler) List(c *gin.Context) { userId := h.GetLoginUserId(c) var items = make([]vo.ChatItem, 0) var chats []model.ChatItem - h.DB.Where("user_id", userId).Order("id DESC").Find(&chats) + h.DB.Debug().Where("user_id", userId).Order("id DESC").Find(&chats) if len(chats) == 0 { resp.SUCCESS(c, items) return diff --git a/web/src/store/jimeng.js b/web/src/store/jimeng.js index 940476a2..8536990f 100644 --- a/web/src/store/jimeng.js +++ b/web/src/store/jimeng.js @@ -6,6 +6,7 @@ // * +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ import { checkSession } from '@/store/cache' +import { useSharedStore } from '@/store/sharedata' import { showMessageError, showMessageOK } from '@/utils/dialog' import { httpDownload, httpGet, httpPost } from '@/utils/http' import { replaceImg, substr } from '@/utils/libs' @@ -40,6 +41,9 @@ export const useJimengStore = defineStore('jimeng', () => { const showDialog = ref(false) const currentVideoUrl = ref('') + // 登录弹窗 + const shareStore = useSharedStore() + // 功能分类配置 const categories = [ { key: 'image_generation', name: '图片生成' }, @@ -133,7 +137,7 @@ export const useJimengStore = defineStore('jimeng', () => { }) const imageEditParams = reactive({ - image_urls: [], + image_urls: '', scale: 0.5, seed: -1, }) @@ -343,7 +347,7 @@ export const useJimengStore = defineStore('jimeng', () => { // 提交任务 const submitTask = async () => { if (!isLogin.value) { - showMessageError('请先登录') + shareStore.setShowLoginDialog(true) return } if (userPower.value < currentPowerCost.value) { diff --git a/web/src/store/video.js b/web/src/store/video.js index e84c01fc..87382323 100644 --- a/web/src/store/video.js +++ b/web/src/store/video.js @@ -7,6 +7,7 @@ import nodata from '@/assets/img/no-data.png' import { checkSession, getSystemInfo } from '@/store/cache' +import { useSharedStore } from '@/store/sharedata' import { closeLoading, showLoading, showMessageError, showMessageOK } from '@/utils/dialog' import { httpDownload, httpGet, httpPost } from '@/utils/http' import { replaceImg, substr } from '@/utils/libs' @@ -37,6 +38,7 @@ export const useVideoStore = defineStore('video', () => { // 用户信息 const isLogin = ref(false) const availablePower = ref(100) + const shareStore = useSharedStore() // 任务筛选 const taskFilter = ref('all') // 'all', 'luma', 'keling' @@ -267,6 +269,11 @@ export const useVideoStore = defineStore('video', () => { } const createLumaVideo = async () => { + if (!isLogin.value) { + shareStore.setShowLoginDialog(true) + return + } + if (!lumaParams.prompt?.trim()) { return ElMessage.error('请输入视频描述') } @@ -365,6 +372,11 @@ export const useVideoStore = defineStore('video', () => { } const createKelingVideo = async () => { + if (!isLogin.value) { + shareStore.setShowLoginDialog(true) + return + } + if (generating.value) return if (!kelingParams.prompt?.trim()) { diff --git a/web/src/views/ChatPlus.vue b/web/src/views/ChatPlus.vue index 7e040d63..06213c4d 100644 --- a/web/src/views/ChatPlus.vue +++ b/web/src/views/ChatPlus.vue @@ -219,8 +219,8 @@ {{ model.power > 0 ? `${model.power}算力` : '免费' }} -
- {{ model.description || '暂无描述' }} +
+ {{ model.desc || '暂无描述' }}