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 || '暂无描述' }}
@@ -488,7 +488,7 @@ const filteredModels = computed(() => { model.description.toLowerCase().includes(modelSearchKeyword.value.toLowerCase())) // 分类匹配 - const matchesCategory = !activeCategory.value || model.category === activeCategory.value + const matchesCategory = !activeCategory.value || model.tag === activeCategory.value // 免费模型匹配 const matchesFree = !showFreeModelsOnly.value || model.power <= 0 @@ -514,8 +514,8 @@ const toggleFreeModels = () => { const updateModelCategories = () => { const categories = new Set() models.value.forEach((model) => { - if (model.category) { - categories.add(model.category) + if (model.tag) { + categories.add(model.tag) } }) modelCategories.value = Array.from(categories) @@ -539,7 +539,7 @@ const updateGroupedModels = () => { // 否则按分类分组展示 const groups = {} filtered.forEach((model) => { - const category = model.category || '未分类' + const category = model.tag || '未分类' if (!groups[category]) { groups[category] = [] } diff --git a/web/src/views/Home.vue b/web/src/views/Home.vue index 0ad5812e..2e70a6a0 100644 --- a/web/src/views/Home.vue +++ b/web/src/views/Home.vue @@ -214,7 +214,6 @@ watch( // 监听路由变化; router.beforeEach((to, from, next) => { curPath.value = to.path - console.log(curPath.value) next() }) diff --git a/web/src/views/Jimeng.vue b/web/src/views/Jimeng.vue index 6e220b2e..63778626 100644 --- a/web/src/views/Jimeng.vue +++ b/web/src/views/Jimeng.vue @@ -282,7 +282,6 @@ type="primary" @click="store.submitTask" :loading="store.submitting" - :disabled="!store.isLogin || store.userPower < store.currentPowerCost" size="large" > 立即生成 ({{ store.currentPowerCost }}) diff --git a/web/src/views/admin/jimeng/JimengSetting.vue b/web/src/views/admin/jimeng/JimengSetting.vue index b77c4980..3a1d56c0 100644 --- a/web/src/views/admin/jimeng/JimengSetting.vue +++ b/web/src/views/admin/jimeng/JimengSetting.vue @@ -7,174 +7,163 @@ label-position="right" ref="configFormRef" :rules="rules" + class="py-3 px-5" > - - + +
+

秘钥配置

+ + + + + + +
+ + +
+

算力配置

+ - - - - - - - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + +
保存配置 @@ -240,7 +229,9 @@ const saveConfig = async () => { await httpPost('/api/admin/jimeng/config/update', jimengConfig.value) ElMessage.success('配置保存成功!') } catch (e) { - ElMessage.error(e.message) + if (e.message) { + ElMessage.error(e.message) + } } finally { saving.value = false }