修复店务独立域名白屏

This commit is contained in:
2026-07-14 17:02:11 +08:00
parent a9e12516df
commit 9059b7a30f
3 changed files with 16 additions and 3 deletions
+6
View File
@@ -617,3 +617,9 @@
- 执行结果:按 Gateway、Core 顺序停服后完成备份与初始化导入;备份文件为 `/tmp/jayu_cloud_backup_20260714153759.sql`;初始化后表数量为 58,默认管理员 `xiaowang` 数量为 1,管理员权限绑定数量为 77,`t_order`、`t_shop`、`t_product` 均为 0。
- 服务恢复:按 Core、Gateway 顺序启动后,6 个 systemd 服务均为 `active`;Nacos 中 `jy-core` 和 `jy-gateway` 均为 3/3 healthy。
- 公网验证:`https://yunail.art/`、`https://www.yunail.art/`、`https://yunail.art/health/check`、`https://salon.yunail.art/health/check` 均返回 200;后台默认管理员登录验证成功,登录密码不写入仓库文档。
## 2026-07-14 店务独立域名白屏修复验收
- 问题复现:Edge 打开 `https://salon.yunail.art/` 时,HTML 返回 200,但 `/jy-salon-front/assets/index-BzCGzWO2.js`、`/jy-salon-front/assets/index-B542WhGN.css` 和 `/jy-salon-front/assets/images/app-icon.png` 均返回 404,页面因此白屏。
- 修复验证:Nginx 新增 `location ^~ /jy-salon-front/` 前缀映射后,`nginx -t` 通过并 reload 成功;远端 curl 验证 `https://salon.yunail.art/jy-salon-front/assets/index-BzCGzWO2.js` 返回 200,响应大小为 116948 字节。
- 浏览器验证:Edge 复测 `https://salon.yunail.art/` 渲染出 `Jayu Salon` 店务登录页;`https://yunail.art/jy-salon-front/` 仍渲染店务登录页;`https://yunail.art/` 仍渲染 `Fingertip Designer 甲屿云` 设计师端登录页。
+4 -3
View File
@@ -245,13 +245,14 @@ MinIO 三副本对象存储所需表结构已经并入 `scripts/sql/init/JayuClo
#### 访问路径
`JY-Salon-Front` 是店务移动端 Web 模块,生产访问路径固定为:
`JY-Salon-Front` 是店务移动端 Web 模块,生产主入口为店务独立域名,兼容路径为根域名子路径:
```text
https://salon.yunail.art/
https://yunail.art/jy-salon-front/
```
Vite `base` 固定为 `/jy-salon-front/`,不能部署到域名根路径,否则静态资源路径会不匹配。
Vite `base` 固定为 `/jy-salon-front/`。即使店务独立域名首页从 `/` 访问,Nginx 也必须保留 `/jy-salon-front/` 静态资源前缀映射,否则 JS、CSS 和图标资源会 404 并导致白屏。
#### 构建产物
@@ -769,7 +770,7 @@ $env:NACOS_USERNAME='nacos'
- 静态资源发布目录:`/opt/jy-artist-frontend/releases/<timestamp>/dist`。
- 当前生效入口:`/opt/jy-artist-frontend/current`,由发布流程切换到最新 release。
- 设计师网页端入口:`https://yunail.art/`,Nginx 根目录指向 `/opt/jy-artist-frontend/current`,SPA 兜底到 `/index.html`。
- 店务网页端入口:`https://salon.yunail.art/`,Nginx 根目录指向 `/opt/jy-artist-frontend/current/jy-salon-front`,SPA 兜底到 `/index.html`。
- 店务网页端入口:`https://salon.yunail.art/`,Nginx 根目录指向 `/opt/jy-artist-frontend/current/jy-salon-front`,SPA 兜底到 `/index.html`;同时必须配置 `location ^~ /jy-salon-front/`,以 `/opt/jy-artist-frontend/current` 为根目录映射带前缀的店务静态资源。
- 后端健康检查:`/health/check` 必须反向代理到网关 upstream `jayu_cloud_gateway`,不能落入前端 SPA 兜底。
- API 代理:`/api/` 和 `/admin/api/` 均代理到 `jayu_cloud_gateway`。
- 当前证书状态:`/etc/letsencrypt/live/yunail.art/fullchain.pem` 为 DNS-01 新签发证书,SAN 覆盖 `yunail.art`、`www.yunail.art`、`salon.yunail.art`,有效期至 2026-10-07 06:14:28 UTC。
+6
View File
@@ -156,3 +156,9 @@
- 执行方式:先通过生产 Nacos `jayu-cloud / DEFAULT_GROUP / datasource.yaml` 和 `infra.yaml` 校验目标均为 `192.168.5.110:3306/jayu_cloud`;数据库连接账号以 Nacos datasource 为准,凭据不写入仓库;预检通过后按 Gateway、Core 顺序停服,备份现库,再导入初始化 SQL,最后按 Core、Gateway 顺序启动。
- 数据库结果:已在 `mysql02` 生成备份 `/tmp/jayu_cloud_backup_20260714153759.sql`;初始化后 `jayu_cloud` 表数量为 58,默认管理员 `xiaowang` 存在,管理员权限绑定数量为 77,`t_order`、`t_shop`、`t_product` 均为空。
- 验证方式:`jy-core` 与 `jy-gateway` 在 Nacos 均恢复为 3/3 healthy;`https://yunail.art/health/check` 与 `https://salon.yunail.art/health/check` 均返回 200;后台默认管理员登录已验证成功,管理员密码不写入仓库文档。
## 2026-07-14 店务独立域名白屏修复
- 变更原因:用户反馈网页打开白屏。浏览器复现确认 `https://salon.yunail.art/` 的 HTML 返回 200,但店务端构建产物固定请求 `/jy-salon-front/assets/...`,生产 Nginx 只将店务独立域名根目录指向 `current/jy-salon-front`,导致带前缀静态资源被拼到重复目录并返回 404。
- 处理方式:在 `salon.yunail.art` 的 443 server block 中新增 `location ^~ /jy-salon-front/`,以 `/opt/jy-artist-frontend/current` 为根目录映射店务端带前缀资源;修改前已备份 `/etc/nginx/nginx.conf.20260714165709.bak`,并通过 `nginx -t` 后 reload。
- 验证方式:`https://salon.yunail.art/jy-salon-front/assets/index-BzCGzWO2.js` 返回 200;Edge 复测 `https://salon.yunail.art/`、`https://yunail.art/jy-salon-front/` 均渲染店务登录页;`https://yunail.art/` 仍渲染设计师端登录页。