diff --git a/.env.production b/.env.production index a9aafec..ea94f09 100644 --- a/.env.production +++ b/.env.production @@ -1,7 +1,7 @@ # 生产环境API基础URL(根据实际情况选择) -VITE_API_BASE=https://2.uzi0.cc/api +VITE_API_BASE=https://uzi1.cn/api # 前端基础URL(用于生成分享链接) -VITE_BASE_URL=https://2.uzi0.cc +VITE_BASE_URL=https://uzi1.cn -IMAGE_BASE_URL=https://2.uzi0.cc/image \ No newline at end of file +IMAGE_BASE_URL=https://uzi1.cn/image \ No newline at end of file diff --git a/DEPLOYMENT.md b/DEPLOYMENT.md index a7ea763..cc2ed0b 100644 --- a/DEPLOYMENT.md +++ b/DEPLOYMENT.md @@ -2,7 +2,7 @@ ## 问题描述 -当直接访问 `http://2.uzi0.cc/play?code=973F2YTE` 时出现404错误,但其他页面正常。这是典型的单页应用(SPA)部署问题。 +当直接访问 `http://uzi1.cn/play?code=973F2YTE` 时出现404错误,但其他页面正常。这是典型的单页应用(SPA)部署问题。 ## 原因分析 @@ -49,12 +49,12 @@ npm run build # 3. 配置 Web 服务器(选择上述方案之一) # 4. 测试访问 -# http://2.uzi0.cc/play?code=973F2YTE 应该能正常访问 +# http://uzi1.cn/play?code=973F2YTE 应该能正常访问 ``` ## 验证步骤 -1. 直接访问:`http://2.uzi0.cc/play?code=973F2YTE` +1. 直接访问:`http://uzi1.cn/play?code=973F2YTE` 2. 应该能看到游戏页面,而不是404错误 3. 刷新页面应该仍然正常 4. API 请求应该正常工作(无CORS错误) diff --git a/nginx.conf b/nginx.conf index bcc81cb..e3636e4 100644 --- a/nginx.conf +++ b/nginx.conf @@ -3,7 +3,7 @@ server { listen 80; - server_name 2.uzi0.cc; + server_name uzi1.cn; root /path/to/your/dist; # 修改为你的实际部署路径 index index.html; diff --git a/src/api/announcement.js b/src/api/announcement.js index 0728445..8b89897 100644 --- a/src/api/announcement.js +++ b/src/api/announcement.js @@ -40,3 +40,8 @@ export function updateAnnouncementStatus(id, enabled) { export function getEnabledAnnouncements(params) { return http.get('/api/admin/announcement/enabled', { params }) } + +// 根据代码获取公告 +export function getAnnouncementByCode(codeNo) { + return http.get(`/api/admin/announcement/by-code/${codeNo}`) +} diff --git a/src/components/play/GamePage.vue b/src/components/play/GamePage.vue index 53b1069..4e34554 100644 --- a/src/components/play/GamePage.vue +++ b/src/components/play/GamePage.vue @@ -21,19 +21,19 @@