chore: update pom.xml Lombok config and deploy settings

- Update Maven compiler plugin to support Lombok annotation processing
- Add deploy.conf for automated deployment
- Update backend models and controllers
- Update frontend pages and API
This commit is contained in:
2026-03-04 12:21:29 +08:00
parent 4646fbc9b5
commit 6f2dc27fbc
20 changed files with 352 additions and 151 deletions

View File

@@ -610,10 +610,20 @@ export default {
this.scrollToBottom();
},
/** 从 Gemini 响应 message.content 提取展示文本(支持 string 或 parts 数组) */
extractReplyContent(content) {
if (content == null) return '';
if (typeof content === 'string') return content;
if (Array.isArray(content)) {
return content.map(part => (part && part.text) ? part.text : '').filter(Boolean).join('');
}
return String(content);
},
async sendToAI(content, type) {
this.isLoading = true;
// 纯文字 / 多模态均走 KieAI GeminiPOST /api/front/kieai/gemini/chat回复仅来自 data.choices[0].message.content
// 文本对话必须走 KieAI GeminiPOST /api/front/kieai/gemini/chat请求体 { messages: [{ role: 'user', content }], stream: false }
if (type === 'text' || type === 'multimodal') {
try {
const messages = [{ role: 'user', content: content }];
@@ -623,11 +633,9 @@ export default {
const data = response.data;
const choice = data.choices && data.choices[0];
const msgObj = choice && choice.message;
// 仅使用接口返回的 content禁止固定话术
const reply = (msgObj && msgObj.content != null)
? (typeof msgObj.content === 'string' ? msgObj.content : String(msgObj.content))
: '未能获取到有效回复。';
this.messageList.push({ role: 'ai', content: reply });
const rawContent = msgObj && msgObj.content;
const reply = rawContent != null ? this.extractReplyContent(rawContent) : '';
this.messageList.push({ role: 'ai', content: reply || '未能获取到有效回复。' });
} else {
const msg = (response && response.message) || '发起对话失败';
this.messageList.push({ role: 'ai', content: '请求失败:' + msg });