This commit is contained in:
Silent YANG 2024-07-02 10:55:12 +08:00
parent 104fdb1f95
commit 1cb7051a5e
4 changed files with 20 additions and 1 deletions

View file

@ -10,6 +10,8 @@ import Components from 'unplugin-vue-components/vite';
import { TDesignResolver } from 'unplugin-vue-components/resolvers';
import { ArcoResolver } from 'unplugin-vue-components/resolvers';
import htmlPlugin from "vite-plugin-html-config";
export default defineConfig({
base: './',
plugins: [
@ -27,6 +29,14 @@ export default defineConfig({
library: 'vue-next'
}), ArcoResolver()],
}),
htmlPlugin({
metas: [
{
name: "builtTime",
content: Math.ceil(parseInt(new Date().toISOString().replace(/[.:TZ-]/g, '')) / 1000).toString()
},
]
})
],
resolve: {
alias: [

View file

@ -75,6 +75,7 @@
"unplugin-vue-components": "^0.26.0",
"vite": "^3.2.5",
"vite-plugin-compression": "^0.5.1",
"vite-plugin-html-config": "^1.0.11",
"vite-plugin-imagemin": "^0.6.1",
"vite-svg-loader": "^3.6.0",
"vue-tsc": "^1.0.14"

View file

@ -1,7 +1,7 @@
<template>
<a-layout-footer class="footer">
<t-space>
<t-link href="https://github.com/silenty4ng/k5web" target="_blank">K5Web - V0.1.202406100220</t-link>
<t-link href="https://github.com/silenty4ng/k5web" target="_blank">K5Web - V0.1.{{ getMetaVersion() }}</t-link>
<t-link v-show="state.isLhw711" href="https://beian.miit.gov.cn/" target="_blank">鲁ICP备2024058690号-1</t-link>
</t-space>
</a-layout-footer>
@ -12,6 +12,9 @@ import { reactive } from 'vue';
const state = reactive({
isLhw711: location.hostname == 'k5.lhw711.cn' ? true : false
})
const getMetaVersion = () => {
return document.getElementsByTagName('meta')['builtTime']?.content
}
</script>
<style lang="less" scoped>

View file

@ -7454,6 +7454,11 @@ vite-plugin-compression@^0.5.1:
debug "^4.3.3"
fs-extra "^10.0.0"
vite-plugin-html-config@^1.0.11:
version "1.0.11"
resolved "https://registry.yarnpkg.com/vite-plugin-html-config/-/vite-plugin-html-config-1.0.11.tgz#7018fb41d17ced527d79f76361e9a9cf587f80bc"
integrity sha512-hUybhgI+/LQQ5q6xoMMsTvI4PBuQD/Wv6Z1vtDPVWjanS8weCIexXuLLYNGD/93f0v8W2hpNfXpmxgpZMahJ0g==
vite-plugin-imagemin@^0.6.1:
version "0.6.1"
resolved "https://registry.npmjs.org/vite-plugin-imagemin/-/vite-plugin-imagemin-0.6.1.tgz"