fix: 修复 1.网页标题与加载动画修改(改为中性文案,避免串品牌)
Co-Authored-By: Claude Code <noreply@anthropic.com>
| | |
| | | name="viewport" |
| | | content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=0" |
| | | /> |
| | | <!-- 由 vite 注入 VITE_APP_TITLE 变量,在 .env 文件内配置 --> |
| | | <title>%VITE_APP_TITLE%</title> |
| | | <!-- 首屏标题固定为中性文案,不要把客户品牌编译进产物(否则换个环境部署就会"串品牌")。 |
| | | 真实品牌由运行时下发:系统管理 → 偏好设置 → 公司信息(后端 system_company_config), |
| | | 启动后覆盖 document.title,见 src/utils/company-config.ts --> |
| | | <title>工业AI智造平台</title> |
| | | <link rel="icon" href="/favicon.ico" /> |
| | | <script> |
| | | var HM_ID = '%VITE_APP_BAIDU_CODE%'; |
| | |
| | | </style> |
| | | <div class="loading" id="__app-loading__"> |
| | | <span class="dot"><i></i><i></i><i></i><i></i></span> |
| | | <div class="title">%VITE_APP_TITLE%</div> |
| | | <!-- 中性文案:加载页早于 JS 执行,拿不到运行时的公司信息,不能写死客户品牌 --> |
| | | <div class="title">正在加载,请稍候…</div> |
| | | </div> |
| | |
| | | </style> |
| | | <div class="loading" id="__app-loading__"> |
| | | <div class="loader"></div> |
| | | <div class="title">%VITE_APP_TITLE%</div> |
| | | <!-- 中性文案:加载页早于 JS 执行,拿不到运行时的公司信息,不能写死客户品牌 --> |
| | | <div class="title">正在加载,请稍候…</div> |
| | | </div> |
| | |
| | | const appApiUrl = company?.apiUrl ?? ''; |
| | | const appName = company?.name ?? ''; |
| | | const isDev = mode === 'development'; |
| | | if (appName) { |
| | | // 覆盖浏览器标签页标题:Vite 的 resolveEnv 优先读 process.env,从而替换 index.html 里的 %VITE_APP_TITLE% |
| | | process.env.VITE_APP_TITLE = appName; |
| | | } |
| | | // 这里不要再把 appName 写进 VITE_APP_TITLE。 |
| | | // 首屏标题、加载页文案已固定为中性文案,品牌统一由运行时「公司信息」下发; |
| | | // 一旦在这里覆盖,某个客户的名称就会被编译进 index.html / 加载页,换个环境部署就"串品牌"。 |
| | | console.log('[company]', companyKey, '-> name:', appName, 'logo:', appLogo, 'api:', appApiUrl || '(from env)'); |
| | | |
| | | const defineVars: Record<string, string> = { |