fix:用户中心新增测试版本号

This commit is contained in:
2026-05-14 14:34:02 +08:00
parent 9a6ca0700e
commit efff88db8e
2 changed files with 16 additions and 0 deletions

View File

@@ -12,6 +12,14 @@ export default defineConfig({
plugins: [
uni(),
],
/** 构建时常量注入__BUILD_TIME__ 在源码中展开为精确的打包时刻字符串 */
define: (() => {
const d = new Date();
const pad = (n) => String(n).padStart(2, '0');
// 格式YYYY.MMDD.HHmm如 2026.0514.1530
const version = `${d.getFullYear()}.${pad(d.getMonth() + 1)}${pad(d.getDate())}.${pad(d.getHours())}${pad(d.getMinutes())}`;
return { __BUILD_TIME__: JSON.stringify(version) };
})(),
})