pujiaming лет назад: 2
Родитель
Сommit
4e9c0fb642
4 измененных файлов с 4 добавлено и 4 удалено
  1. 1 1
      .env.development
  2. 1 1
      .env.production.kupai
  3. 1 1
      src/utils/version.ts
  4. 1 1
      src/vite-env.d.ts

+ 1 - 1
.env.development

@@ -1,4 +1,4 @@
-VITE_ENV = development,
+VITE_ENV = 'development',
 VITE_PROJECT_NAME = 朱雀游戏中心
 # VITE_PROJECT_NAME = 游戏中心
 # VITE_API_HOST = http://gm.coolpad.nkfzs.com/api/web

+ 1 - 1
.env.production.kupai

@@ -1,4 +1,4 @@
-VITE_ENV = production,
+VITE_ENV = 'production',
 VITE_PROJECT_NAME = 游戏中心
 VITE_API_HOST = http://gm.coolpad.nkfzs.com/api/web
 # VITE_LOGO: 'QingQue'

+ 1 - 1
src/utils/version.ts

@@ -5,7 +5,7 @@ declare global { // 设置全局属性
 }
 export function getVersion() {
   // main.js 和 拦截器中加入
-  if (('pendingETAG' in window && window.pendingETAG) || import.meta.env.VITE_ENV === 'development') return
+  if (('pendingETAG' in window && window.pendingETAG) || import.meta.env.DEV) return
   const htmlFileUrl = `${location.origin}${location.pathname}`
   window.pendingETAG = true
   setTimeout(() => {

+ 1 - 1
src/vite-env.d.ts

@@ -14,7 +14,7 @@ interface ImportMetaEnv {
 
     readonly DEV: boolean
 
-    readonly VITE_ENV: boolean
+    readonly VITE_ENV: 'development'|'production'
 
 }