diff --git a/frontend/app/web-gold/src/api/userPrompt.js b/frontend/app/web-gold/src/api/userPrompt.js index 27e34bb375..43540c6b34 100644 --- a/frontend/app/web-gold/src/api/userPrompt.js +++ b/frontend/app/web-gold/src/api/userPrompt.js @@ -15,7 +15,12 @@ export const UserPromptApi = { * @returns {Promise} 响应数据 */ createUserPrompt: async (data) => { - return await http.post(`${SERVER_BASE_AI}/user-prompt/create`, data) + console.log('[UserPromptApi] 发送请求参数:', JSON.stringify(data, null, 2)) + return await http.post(`${SERVER_BASE_AI}/user-prompt/create`, data, { + headers: { + 'Content-Type': 'application/json' + } + }) }, /** diff --git a/frontend/app/web-gold/src/views/content-style/components/SavePromptModal.vue b/frontend/app/web-gold/src/views/content-style/components/SavePromptModal.vue index 6d3a97ec11..d2edd46614 100644 --- a/frontend/app/web-gold/src/views/content-style/components/SavePromptModal.vue +++ b/frontend/app/web-gold/src/views/content-style/components/SavePromptModal.vue @@ -54,17 +54,27 @@ async function handleSave() { savingPrompt.value = true try { + // 确保 content 字段有值 + const content = savePromptForm.value.content?.trim() || '' + if (!content) { + message.error('提示词内容不能为空') + savingPrompt.value = false + return + } + const payload = { userId: userId, name: savePromptForm.value.name.trim(), - content: savePromptForm.value.content.trim(), - category: savePromptForm.value.category.trim() || null, + content: content, // 确保 content 有值 + category: savePromptForm.value.category?.trim() || null, isPublic: false, sort: 0, useCount: 0, status: 1, } + console.log('[SavePromptModal] 发送请求参数:', payload) + const response = await UserPromptApi.createUserPrompt(payload) if (response && (response.code === 0 || response.code === 200)) { diff --git a/frontend/app/web-gold/src/views/dh/Video.vue b/frontend/app/web-gold/src/views/dh/Video.vue index 5e84b73c87..3da8d428cc 100644 --- a/frontend/app/web-gold/src/views/dh/Video.vue +++ b/frontend/app/web-gold/src/views/dh/Video.vue @@ -1,7 +1,5 @@