This commit is contained in:
2025-11-19 01:39:56 +08:00
parent cc8e503f49
commit f052b0af65
11 changed files with 956 additions and 1124 deletions

View File

@@ -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)) {