feat: 完成Nacos配置优化和WebSocket集成

主要更新:
1. 统一所有微服务端口配置(19000-19008)
2. 为所有服务创建本地/测试/生产三套环境配置
3. 配置Nacos认证密码(本地:Peanut2817*#, 测试/生产:EmotionMuseum2025)
4. 优化网关路由配置,支持负载均衡和WebSocket
5. 新增emotion-websocket模块,支持实时聊天
6. 前端集成WebSocket,替代HTTP轮询
7. 添加配置验证和管理工具脚本

技术特性:
- 完整的环境隔离和服务发现
- WebSocket实时通信支持
- 负载均衡路由配置
- 跨域和安全配置
- 自动重连和心跳检测
This commit is contained in:
2025-07-17 18:10:45 +08:00
parent 9a3a8267b5
commit c77352877d
391 changed files with 46585 additions and 4294 deletions
-84
View File
@@ -1,84 +0,0 @@
import { createRouter, createWebHistory } from 'vue-router'
const routes = [
{
path: '/',
name: 'Home',
component: () => import('@/views/Home.vue'),
meta: {
title: '情绪博物馆 - 首页'
}
},
{
path: '/test',
name: 'Test',
component: () => import('@/views/HomeTest.vue'),
meta: {
title: '情绪博物馆 - 测试页面'
}
},
{
path: '/chat',
name: 'Chat',
component: () => import('@/views/ChatComplete.vue'),
meta: {
title: 'AI对话 - 情绪博物馆'
}
},
{
path: '/history',
name: 'History',
component: () => import('@/views/HistorySimple.vue'),
meta: {
title: '对话历史 - 情绪博物馆'
}
},
{
path: '/analysis',
name: 'Analysis',
component: () => import('@/views/AnalysisSimple.vue'),
meta: {
title: '情绪分析 - 情绪博物馆'
}
},
{
path: '/login',
name: 'Login',
component: () => import('@/views/Login.vue'),
meta: {
title: '登录注册 - 情绪博物馆'
}
}
]
const router = createRouter({
history: createWebHistory(import.meta.env.BASE_URL),
routes
})
// 路由守卫
router.beforeEach((to, from, next) => {
// 设置页面标题
if (to.meta.title) {
document.title = to.meta.title
}
// 检查是否需要认证
const requiresAuth = to.meta.requiresAuth
const token = localStorage.getItem('token')
if (requiresAuth && !token) {
// 需要认证但没有token,跳转到登录页
next({
path: '/login',
query: { redirect: to.fullPath }
})
} else if (to.path === '/login' && token) {
// 已登录用户访问登录页,跳转到首页
next('/')
} else {
next()
}
})
export default router