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}算力` : '免费' }} -