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

技术特性:
- 完整的环境隔离和服务发现
- WebSocket实时通信支持
- 负载均衡路由配置
- 跨域和安全配置
- 自动重连和心跳检测
2025-07-17 18:10:45 +08:00

82 lines
1.5 KiB
Vue
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.
<template>
<div id="app">
<router-view />
<!-- 环境信息组件仅在非生产环境显示 -->
<EnvInfo />
</div>
</template>
<script setup>
import { onMounted } from 'vue'
import { useUserStore } from '@/stores/user'
import { debugLog } from '@/config/env'
import EnvInfo from '@/components/EnvInfo.vue'
const userStore = useUserStore()
onMounted(() => {
try {
// 初始化用户信息
userStore.initUser()
debugLog('App.vue loaded successfully, user:', userStore.userInfo)
} catch (error) {
console.error('App.vue 初始化失败:', error)
// 确保有一个默认的访客用户状态
userStore.setGuestMode()
}
})
</script>
<style lang="scss">
#app {
min-height: 100vh;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
// 全局滚动条样式
::-webkit-scrollbar {
width: 6px;
height: 6px;
}
::-webkit-scrollbar-track {
background: rgba(255, 255, 255, 0.1);
border-radius: 3px;
}
::-webkit-scrollbar-thumb {
background: rgba(255, 255, 255, 0.3);
border-radius: 3px;
&:hover {
background: rgba(255, 255, 255, 0.5);
}
}
// 自定义动画
.fade-enter-active,
.fade-leave-active {
transition: opacity 0.3s ease;
}
.fade-enter-from,
.fade-leave-to {
opacity: 0;
}
.slide-up-enter-active,
.slide-up-leave-active {
transition: all 0.3s ease;
}
.slide-up-enter-from {
transform: translateY(20px);
opacity: 0;
}
.slide-up-leave-to {
transform: translateY(-20px);
opacity: 0;
}
</style>