fix: slice commit 6

This commit is contained in:
YunYouJun
2022-12-19 06:20:17 +08:00
parent f72fd0b3bb
commit dec01500b7

View File

@@ -8,7 +8,7 @@ onBeforeMount(() => {
displayICP.value = ['cook.yunyoujun.cn', 'localhost', '127.0.0.1'].includes(window.location.hostname) displayICP.value = ['cook.yunyoujun.cn', 'localhost', '127.0.0.1'].includes(window.location.hostname)
}) })
const commitSha = import.meta.env.VITE_COMMIT_REF || '' const commitSha = (import.meta.env.VITE_COMMIT_REF || '').slice(0, 7)
const now = import.meta.env.VITE_APP_BUILD_TIME const now = import.meta.env.VITE_APP_BUILD_TIME
const buildDate = (new Date(parseInt(now) * 1000)).toLocaleDateString() const buildDate = (new Date(parseInt(now) * 1000)).toLocaleDateString()
</script> </script>
@@ -16,7 +16,14 @@ const buildDate = (new Date(parseInt(now) * 1000)).toLocaleDateString()
<template> <template>
<div p="4" class="flex flex-col justify-center items-center" text="sm"> <div p="4" class="flex flex-col justify-center items-center" text="sm">
<div v-if="commitSha && buildDate" mb-2> <div v-if="commitSha && buildDate" mb-2>
当前版本 {{ buildDate }} : {{ commitSha }} <span>
当前版本{{ buildDate }}:
</span>
<span>
<a border="b-1 dashed" :href="`https://github.com/YunYouJun/cook/commit/${commitSha}`" target="_blank" alt="Cook | GitHub Commit">
{{ commitSha }}
</a>
</span>
</div> </div>
<a v-if="displayICP" opacity="80" class="flex" href="https://beian.miit.gov.cn/" target="_blank"> <a v-if="displayICP" opacity="80" class="flex" href="https://beian.miit.gov.cn/" target="_blank">
苏ICP备17038157号 苏ICP备17038157号