fix: ui version commitid

This commit is contained in:
jialin
2024-07-12 12:13:00 +08:00
parent 320db56fbe
commit d839464a05
2 changed files with 4 additions and 2 deletions
+1 -1
View File
@@ -9,5 +9,5 @@ export const getBranchInfo = () => {
.execSync(`git tag --contains ${latestCommit}`)
.toString()
.trim();
return { version: versionTag || 'dev', commitId: latestCommit.slice(0, 7) };
return { version: versionTag || '', commitId: latestCommit.slice(0, 7) };
};
+3 -1
View File
@@ -6,7 +6,9 @@ export default (api: IApi) => {
const env = process.env.NODE_ENV;
$('html').attr(
'data-version',
env === 'production' ? info.version : `${info.version}-${info.commitId}`
env === 'production'
? info.version || info.commitId
: `dev-${info.commitId}`
);
return $;
});