feat: 完成原型04-10全链路功能开发,包括AI助手、PDF导出等

This commit is contained in:
hujun
2026-09-28 17:50:46 +08:00
parent 7c252fc730
commit 79feb03b19
27 changed files with 1083 additions and 180 deletions
-12
View File
@@ -1,18 +1,6 @@
import { API_DEMO_ENABLED, API_BASE_URL, wait, requestJson } from '@/services/api.uts'
import { createAssessment } from './records.uts'
export { API_BASE_URL } from '@/services/api.uts'
export async function submitAssessment(payload: UTSJSONObject): Promise<string> {
return await createAssessment(payload)
}
export async function sendAssistantMessage(message: string): Promise<string> {
if (API_DEMO_ENABLED) {
await wait(600)
return '结合您的评估结果,建议优先选择年化利率较低、可随借随还的产品,并重点确认提前还款规则。'
}
const result = await requestJson('/assistant/messages', 'POST', { message })
const reply = result['reply'] as string | null
if (reply == null || reply.length == 0) throw new Error('助手暂时没有返回内容')
return reply
}