3 Commits

Author SHA1 Message Date
liufumingren
ed98349ea2 chore: 清理指向 api.oms.gztbyc.com 的残留引用
- env 样板:OMS_CALLBACK_BASE_URL 改为 https://oms.gztbyc.com(后端/发布两处)
- 前端:env.d.ts 示例与 mediaUrl() 注释改为同源说明(生产 /api 不再跨域)
- DEPLOY.md:旧域名章节改为「已下线」,说明目录 /www/wwwroot/api.oms.gztbyc.com/
  只是发布目录名、与域名无关;同源章节去掉「保留 CORS 给老域名」的过时说明
- deploy.config.example.cjs:注明 include 路径与域名是否对外服务无关

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-11-01 23:41:08 +08:00
liufumingren
122eb9ccc9 feat(frontend): 生产改为同源 /api,前端挂到后端域名的根目录
- frontend/.env.production: VITE_API_BASE_URL 由 https://api.oms.gztbyc.com/api 改为 /api
- tools/DEPLOY.md: 新增单站点 Nginx 配置(root=current、/api/ include upstream、SPA try_files 回退),
  域名/CORS 章节改为同源说明
- tools/config/deploy.config.example.cjs: Nginx 前置说明同步为单站点

同源后不再需要 CORS,后端切换 v1/v2 端口时前端产物无需重新构建。

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-30 23:13:44 +08:00
liufumingren
406e5f3b58 refactor(tools): 发布工具统一到 tools(前后端同时发布 + git 约束 + 共享配置)
- 新增 tools TypeScript 发布 CLI:deploy / deploy:backend / deploy:frontend / rollback / init
- 删除 backend/script 与 frontend/scripts 旧发布脚本,前后端 npm scripts 转发到 tools
- 发布配置独立为 tools/config/deploy.config.local.cjs(模板入库,真实配置与生产 env 不入库)
- 发布受限于 git:工作区有未提交改动默认中止(--allow-dirty 放行),版本记录含 commit/branch
- 后端配置集中到 <deployRoot>/shared-config,本地 env 发布时覆盖共享配置;端口由 EGG_PORT 注入
- 前端服务器端脚本迁至 tools/remote,失败时清理未上线版本目录
- .gitignore 改为忽略 tools 本地配置与临时发布包

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-30 23:04:54 +08:00