林旭祥 3 settimane fa
parent
commit
2251bdda09
5 ha cambiato i file con 5 aggiunte e 13 eliminazioni
  1. 1 1
      .env.development
  2. 1 1
      .env.production
  3. 0 8
      src/types/auto-imports.d.ts
  4. 2 2
      src/views/set/index.vue
  5. 1 1
      vite.config.ts

+ 1 - 1
.env.development

@@ -8,4 +8,4 @@ VITE_APP_CONTEXT_PATH = '/'
 # 获取配置项
 VITE_APP_BASE_CTRL = 'https://allctrltst.tropsx.com'
 # 获取git提交记录编码
-VITE_GIT_SHA1 = '999'
+VITE_GIT_HASH = `git rev-parse HEAD`

+ 1 - 1
.env.production

@@ -8,4 +8,4 @@ VITE_APP_CONTEXT_PATH = '/'
 # 获取配置项
 VITE_APP_BASE_CTRL = 'https://allctrl.tropsx.com'
 # 获取git提交记录编码
-VITE_GIT_SHA1 = $(git rev-parse HEAD)
+VITE_GIT_HASH = `git rev-parse HEAD`

+ 0 - 8
src/types/auto-imports.d.ts

@@ -296,10 +296,6 @@ declare module 'vue' {
   interface GlobalComponents {}
   interface ComponentCustomProperties {
     readonly EffectScope: UnwrapRef<typeof import('vue')['EffectScope']>
-    readonly ElLoading: UnwrapRef<typeof import('element-plus/es')['ElLoading']>
-    readonly ElMessage: UnwrapRef<typeof import('element-plus/es')['ElMessage']>
-    readonly ElMessageBox: UnwrapRef<typeof import('element-plus/es')['ElMessageBox']>
-    readonly ElNotification: UnwrapRef<typeof import('element-plus/es')['ElNotification']>
     readonly acceptHMRUpdate: UnwrapRef<typeof import('pinia')['acceptHMRUpdate']>
     readonly asyncComputed: UnwrapRef<typeof import('@vueuse/core')['asyncComputed']>
     readonly autoResetRef: UnwrapRef<typeof import('@vueuse/core')['autoResetRef']>
@@ -579,10 +575,6 @@ declare module '@vue/runtime-core' {
   interface GlobalComponents {}
   interface ComponentCustomProperties {
     readonly EffectScope: UnwrapRef<typeof import('vue')['EffectScope']>
-    readonly ElLoading: UnwrapRef<typeof import('element-plus/es')['ElLoading']>
-    readonly ElMessage: UnwrapRef<typeof import('element-plus/es')['ElMessage']>
-    readonly ElMessageBox: UnwrapRef<typeof import('element-plus/es')['ElMessageBox']>
-    readonly ElNotification: UnwrapRef<typeof import('element-plus/es')['ElNotification']>
     readonly acceptHMRUpdate: UnwrapRef<typeof import('pinia')['acceptHMRUpdate']>
     readonly asyncComputed: UnwrapRef<typeof import('@vueuse/core')['asyncComputed']>
     readonly autoResetRef: UnwrapRef<typeof import('@vueuse/core')['autoResetRef']>

+ 2 - 2
src/views/set/index.vue

@@ -35,7 +35,7 @@
 const { proxy } = getCurrentInstance() as any;
 const router = useRouter();
 const data = reactive<any>({
-  gitSha1: __VUE_APP_GIT_SHA1__
+  gitSha1: ""
 });
 const { gitSha1 } = toRefs(data);
 
@@ -79,7 +79,7 @@ const confirmExit = () => {
 };
 
 onMounted(() => {
-
+  gitSha1.value = `${__VITE_GIT_HASH__}`
 })
 </script>
 

+ 1 - 1
vite.config.ts

@@ -16,7 +16,7 @@ export default defineConfig(({ mode, command }: ConfigEnv): UserConfig => {
     // https://cn.vitejs.dev/config/#resolve-extensions
     plugins: createPlugins(env, command === 'build'),
     define: {
-      __VUE_APP_GIT_SHA1__: JSON.stringify(process.env.VITE_GIT_SHA1)
+      __VITE_GIT_HASH__: JSON.stringify(process.env.VITE_GIT_HASH),
     },
     server: {
       host: '0.0.0.0',