fix: production deployment improvements and configuration fixes #1

Merged
let5see merged 2 commits from fix/production-deployment-improvements into main 2026-01-26 17:21:39 +08:00
Owner

概述

本 PR 修复了生产环境部署过程中遇到的多个关键问题,包括配置硬编码、路径错误、构建失败等问题。

主要改动

1. 修复二维码地址硬编码问题 🔧

  • 问题: MainDisplay.vue 中移动端 URL 被硬编码为 http://192.168.1.5:5174
  • 解决方案:
    • 改为使用环境变量 VITE_MOBILE_URL
    • 添加 fallback 机制,未配置时使用 window.location.origin
    • 支持通过 .env 文件动态配置
  • 影响: 二维码现在可以根据部署环境自动调整,无需修改代码

2. 修复音频文件路径问题 🎵

  • 问题: 音频文件路径缺少 /screen 前缀,导致 404 错误
  • 解决方案: 修正 display.ts 中的音频路径
    • bgm.mp3/screen/audio/bgm.mp3
    • lottery.mp3/screen/audio/lottery.mp3
    • fanfare.mp3/screen/audio/fanfare.mp3
  • 影响: BGM 和音效现在可以正常播放
## 概述 本 PR 修复了生产环境部署过程中遇到的多个关键问题,包括配置硬编码、路径错误、构建失败等问题。 ## 主要改动 ### 1. 修复二维码地址硬编码问题 🔧 - **问题**: `MainDisplay.vue` 中移动端 URL 被硬编码为 `http://192.168.1.5:5174` - **解决方案**: - 改为使用环境变量 `VITE_MOBILE_URL` - 添加 fallback 机制,未配置时使用 `window.location.origin` - 支持通过 `.env` 文件动态配置 - **影响**: 二维码现在可以根据部署环境自动调整,无需修改代码 ### 2. 修复音频文件路径问题 🎵 - **问题**: 音频文件路径缺少 `/screen` 前缀,导致 404 错误 - **解决方案**: 修正 `display.ts` 中的音频路径 - `bgm.mp3` → `/screen/audio/bgm.mp3` - `lottery.mp3` → `/screen/audio/lottery.mp3` - `fanfare.mp3` → `/screen/audio/fanfare.mp3` - **影响**: BGM 和音效现在可以正常播放
let5see added 1 commit 2026-01-26 17:16:38 +08:00
## 主要改动

### 1. 修复二维码地址硬编码问题
- 将 MainDisplay.vue 中硬编码的移动端 URL 改为环境变量配置
- 添加 VITE_MOBILE_URL 环境变量支持
- 支持通过 .env 文件动态配置移动端地址

### 2. 修复音频文件路径问题
- 修正 display.ts 中音频文件路径,添加 /screen 前缀
- 修复 BGM、抽奖音效、胜利音效的加载路径

### 3. 修复 Docker 构建问题
- 添加中国 npm 镜像配置,解决构建超时问题
- 修复缺失的 tsconfig.base.json 文件拷贝
- 修复 Redis 环境变量配置(REDIS_HOST/REDIS_PORT)
- 添加 Lua 脚本文件拷贝到生产容器

### 4. 修复前端路由和资源加载
- 添加 Vite base path 配置 (/screen/)
- 修复 Vue Router base path 配置
- 修正 Caddyfile 路由顺序,确保 /screen 路径优先匹配

### 5. 修复 TypeScript 编译错误
- LuckyDrawView.vue: 添加 round 属性类型定义
- ProgramCard.vue: 添加非空断言处理

### 6. 修复 SCSS 变量问题
- 替换未定义的 SCSS 变量为硬编码颜色值
- 修复 VoteView、ConnectionStatus、HomeView、ScanLoginView 中的样式问题

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
let5see added 1 commit 2026-01-26 17:17:54 +08:00
let5see closed this pull request 2026-01-26 17:19:11 +08:00
let5see reopened this pull request 2026-01-26 17:20:38 +08:00
let5see merged commit 2b34d14e96 into main 2026-01-26 17:21:39 +08:00
let5see referenced this issue from a commit 2026-01-26 17:21:39 +08:00
let5see deleted branch fix/production-deployment-improvements 2026-01-26 17:24:49 +08:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: let5see/company-celebration#1