Files
en-edu/enlish-vue/src/router/index.js
lbw 2d76ed507e feat(tts): 集成OpenAI语音合成功能并支持计划单词语音生成
- 新增TTS工具类TTSUtil,实现文本到语音的转换并通过HTTP响应返回音频流
- 在LessonPlanController添加获取计划单词列表及单词语音生成接口
- 前端新增PlanTTS页面,实现计划单词TTS的加载、生成、播放及下载功能
- 路由新增PlanTTS路由,支持访问TTS生成功能页面
- 配置文件application-dev.yml新增OpenAI TTS相关配置
- WordExportUtil生成计划文档时嵌入对应页面二维码图片
- 引入spring-ai-openai相关依赖支持OpenAI模型调用
- 新增单词语音相关请求与响应VO类,方便接口数据传输
- 新增计划单词获取接口plan/word/voice对应前端api
- 新增计划单词语音合成接口plan/word/voice/tts对应前端api
- 添加二维码生成逻辑,用于生成计划文档中的二维码图片链接
- 添加单元测试模版VoiceTest,预留TTS工具类测试接口
2025-12-29 12:44:16 +08:00

65 lines
1.8 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import Uploadpng from '@/pages/uploadpng.vue'
import LearningPlan from '@/pages/LearningPlan.vue'
import Class from '@/pages/class.vue'
import { createRouter, createWebHashHistory } from 'vue-router'
import Admid from '@/pages/admid/admid.vue'
import Student from '@/pages/student.vue'
import PlanTTS from '@/pages/PlanTTS.vue'
// 统一在这里声明所有路由
const routes = [
{
path: '/', // 路由地址
component: Class, // 对应组件
meta: { // meta 信息
title: '班级' // 页面标题
}
},
{
path: '/uploadpng', // 路由地址
component: Uploadpng, // 对应组件
meta: { // meta 信息
title: '上传图片' // 页面标题
}
},
{
path: '/learningplan', // 路由地址
component: LearningPlan, // 对应组件
meta: { // meta 信息
title: '学案' // 页面标题
}
},
{
path: '/student/:id', // 路由地址
component: Student, // 对应组件
meta: { // meta 信息
title: '学生详情' // 页面标题
}
},
{
path: '/admid', // 路由地址
component: Admid, // 对应组件
meta: { // meta 信息
title: '管理员页面' // 页面标题
}
},
{
path: '/plan/tts',
component: PlanTTS,
meta: {
title: 'TTS生成'
}
}
]
// 创建路由
const router = createRouter({
// 指定路由的历史管理方式hash 模式指的是 URL 的路径是通过 hash 符号(#)进行标识
history: createWebHashHistory(),
// routes: routes 的缩写
routes,
})
// ES6 模块导出语句,它用于将 router 对象导出,以便其他文件可以导入和使用这个对象
export default router