tangning 3 months ago
parent
commit
7a93f2bde8
4 changed files with 46 additions and 1 deletions
  1. 39 0
      .env.mingjing
  2. 3 0
      .env.production
  3. 1 0
      package.json
  4. 3 1
      src/store/modules/app.ts

+ 39 - 0
.env.mingjing

@@ -0,0 +1,39 @@
+NODE_ENV=production
+# Whether to open mock
+VITE_USE_MOCK = true
+
+# public path
+VITE_PUBLIC_PATH = /
+
+# Delete console
+VITE_DROP_CONSOLE = true
+
+# Whether to enable gzip or brotli compression
+# Optional: gzip | brotli | none
+# If you need multiple forms, you can use `,` to separate
+VITE_BUILD_COMPRESS = 'none'
+
+# Whether to delete origin files when using compress, default false
+VITE_BUILD_COMPRESS_DELETE_ORIGIN_FILE = false
+
+# Basic interface address SPA
+VITE_GLOB_API_URL=/basic-api
+
+# File upload address, optional
+# It can be forwarded by nginx or write the actual address directly
+VITE_GLOB_UPLOAD_URL=/upload
+
+# Interface prefix
+VITE_GLOB_API_URL_PREFIX=
+
+# Whether to enable image compression
+VITE_USE_IMAGEMIN= true
+
+# use pwa
+VITE_USE_PWA = false
+
+# Is it compatible with older browsers
+VITE_LEGACY = false
+
+
+VITE_GLOB_APP_TITLE = 广东省公安厅

+ 3 - 0
.env.production

@@ -36,3 +36,6 @@ VITE_USE_PWA = false
 
 # Is it compatible with older browsers
 VITE_LEGACY = false
+
+VITE_GLOB_APP_TITLE = 江门公安
+

+ 1 - 0
package.json

@@ -12,6 +12,7 @@
     "dev": "vite",
     "build": "cross-env NODE_ENV=production vite build && esno ./build/script/postBuild.ts",
     "build:test": "cross-env vite build --mode test && esno ./build/script/postBuild.ts",
+    "build:mingjing": "cross-env NODE_ENV=production vite build --mode mingjing && esno ./build/script/postBuild.ts",
     "build:no-cache": "yarn clean:cache && npm run build",
     "report": "cross-env REPORT=true npm run build",
     "type:check": "vue-tsc --noEmit --skipLibCheck",

+ 3 - 1
src/store/modules/app.ts

@@ -6,6 +6,7 @@ import type {
   MultiTabsSetting,
 } from '/#/config';
 import type { BeforeMiniState } from '/#/store';
+import { getAppEnvConfig } from '/@/utils/env';
 
 import { defineStore } from 'pinia';
 import { store } from '/@/store';
@@ -44,7 +45,8 @@ export const useAppStore = defineStore({
       return this.pageLoading;
     },
     getTitle(): string {
-      return this.title;
+      const { VITE_GLOB_APP_TITLE } = getAppEnvConfig();
+      return VITE_GLOB_APP_TITLE || this.title;
     },
     getDarkMode(): 'light' | 'dark' | string {
       return this.darkMode || localStorage.getItem(APP_DARK_MODE_KEY_) || darkMode;