From d82b26f388cbc0316a9903f7cc0d6013c08d2324 Mon Sep 17 00:00:00 2001 From: guanj Date: Thu, 9 Oct 2025 11:32:15 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=89=93=E5=8C=85=E5=91=BD?= =?UTF-8?q?=E4=BB=A4=20=E5=8C=BA=E5=88=86=E9=A1=B9=E7=9B=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.BJ | 2 + .env.WX | 2 + .env.development | 1 + auto-imports.d.ts | 3 +- package.json | 4 + src/App.vue | 13 +- src/api/statistics/index.ts | 8 + src/router/index.ts | 8 +- src/utils/webSocketClient.ts | 8 +- .../components/informationTable.vue | 578 +++++++++--------- vite.config.ts | 6 +- 11 files changed, 343 insertions(+), 290 deletions(-) create mode 100644 .env.BJ create mode 100644 .env.WX diff --git a/.env.BJ b/.env.BJ new file mode 100644 index 0000000..b228229 --- /dev/null +++ b/.env.BJ @@ -0,0 +1,2 @@ +NODE_ENV = 'beijing' +VITE_NAME = "beijing" \ No newline at end of file diff --git a/.env.WX b/.env.WX new file mode 100644 index 0000000..21efc2d --- /dev/null +++ b/.env.WX @@ -0,0 +1,2 @@ +NODE_ENV = 'wuxi' +VITE_NAME = "wuxi" \ No newline at end of file diff --git a/.env.development b/.env.development index 5a7c834..9e40fc3 100644 --- a/.env.development +++ b/.env.development @@ -1,2 +1,3 @@ NODE_ENV = 'development' +VITE_NAME = "development" VITE_APP_BASE_API = http://120.24.64.5:8088/mall-admin \ No newline at end of file diff --git a/auto-imports.d.ts b/auto-imports.d.ts index b5eb079..918aad8 100644 --- a/auto-imports.d.ts +++ b/auto-imports.d.ts @@ -4,6 +4,5 @@ // Generated by unplugin-auto-import export {} declare global { - const ElMessage: typeof import('element-plus/es')['ElMessage'] - const ElMessageBox: typeof import('element-plus/es')['ElMessageBox'] + } diff --git a/package.json b/package.json index 22a6f71..86ce228 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,11 @@ "type": "module", "scripts": { "dev": "vite --host", + "dev:BJ": "vite --host --mode BJ", + "dev:WX": "vite --host --mode WX", "build": "vue-tsc && vite build", + "build:BJ": "vue-tsc && vite build --mode BJ", + "build:WX": "vue-tsc && vite build --mode WX", "preview": "vite preview" }, "dependencies": { diff --git a/src/App.vue b/src/App.vue index ed87b0c..7188439 100644 --- a/src/App.vue +++ b/src/App.vue @@ -23,10 +23,14 @@ window.addEventListener("message", (event) => { }); // setTimeout(() => { -store.dispatch("loginAction", { - username: "cdf", - password: "@#001njcnpqs", -}); +console.log("🚀 ~ import.meta.env.VITE_NAME:", import.meta.env.VITE_NAME) +if (import.meta.env.VITE_NAME == 'wuxi') { + store.dispatch("loginAction", { + username: "cdf", + password: "@#001njcnpqs", + }); +} + // }, 100); onBeforeMount(() => { window.sessionStorage.setItem("token", ""); @@ -36,6 +40,7 @@ onBeforeMount(() => { - diff --git a/vite.config.ts b/vite.config.ts index 2bc90d1..5965fcd 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -55,9 +55,9 @@ export default ({ command, mode }) => { // target: "http://192.168.1.63/api/", // target: "http://192.168.1.133:4000/api/", //target: "http://192.168.1.62:10215", - // target: 'http://192.168.1.127:19001', //cdf - //target: 'http://192.168.1.133:19001', //cdf - target: 'http://192.168.1.127:19001', //cdf + target: 'http://192.168.1.127:18093', //cdf + // target: 'http://192.168.1.63/api', //cdf + // target: 'http://192.168.1.130:18093', //cdf changeOrigin: true, secure: false, rewrite: (path) => path.replace(/^\/api/, ""),