Files
MailUI4Agents/client/electron/src/vite-env.d.ts
JianFeeeee be13ae5959 feat(webui): 界面加构建戳 —— 让"我这边改了没"变成可核对的
用户连续三轮说「webui 还没改」,而我每次都能证明部署是活的(入口 no-cache、
资源哈希 immutable、线上 bundle 与本地构建逐字节一致、无头浏览器实测生效)——
问题在于**隔着屏幕说不清对方的浏览器跑的是哪一份**。

现在界面里显示一行 `界面构建 <git短哈希>·<月日-时分>`(外观设置面板页脚):

- `vite.config.ts` 在构建时注入 `__BUILD_STAMP__`(git 短哈希 + 构建时刻)
- `BackgroundPicker` 渲染它,并带 title 说明格式
- 判据 4 条(vite 注入 / 组件渲染 / **产物里真的有** / 判据自检:正则不能匹配随便一段文本)

实测:产物与线上都是 `d2904fc·0914-0910`;刷新后数字变了就是拿到了新构建。

顺带修正一处过时文案:图片说明还写着"保存在本机",而它现在同时存到账号里
(服务端 + 本地缓存)。

前端 254 条 + 新增 4 条、打包一致性、server 10 包全绿;桌面包已重打。
2026-09-14 09:11:36 +08:00

15 lines
357 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/// <reference types="vite/client" />
/** 构建期可注入的环境变量 */
interface ImportMetaEnv {
/** API 基地址;不设则用同源 /api/v1 */
readonly VITE_API_BASE?: string;
}
interface ImportMeta {
readonly env: ImportMetaEnv;
}
/** 构建戳vite define 注入,见 vite.config.ts。 */
declare const __BUILD_STAMP__: string;