From 3e62a2c1d5919d11711d508a675c7cfb6af677fe Mon Sep 17 00:00:00 2001
From: lipenghui <mrkezhi@163.com>
Date: Thu, 25 Jan 2024 19:00:51 +0800
Subject: [PATCH] =?UTF-8?q?fix:=E4=BF=AE=E6=94=B9=E6=89=93=E5=8C=85?=
 =?UTF-8?q?=E9=85=8D=E7=BD=AE=EF=BC=9B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .env.production     | 6 +++---
 package.json        | 2 +-
 src/router/index.ts | 4 ++--
 vite.config.ts      | 3 ---
 4 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/.env.production b/.env.production
index 40563ef..76b6fc2 100644
--- a/.env.production
+++ b/.env.production
@@ -1,11 +1,11 @@
 # 正式环境
 
 # 公共地址
-VITE_GLOB_BASE_URL = "http://223.99.228.207:19872"
+VITE_GLOB_BASE_URL = "http://192.168.1.134:9872"
 
 # 本地MQTT地址
-VITE_GLOB_MQTT_HOST = "223.99.228.240"
-VITE_GLOB_MQTT_PORT = 28083
+VITE_GLOB_MQTT_HOST = "192.168.1.231"
+VITE_GLOB_MQTT_PORT = 8083
 VITE_GLOB_MQTT_PROTOCOL = "ws"
 
 # 本地MQTT用户名
diff --git a/package.json b/package.json
index 1854cf3..2dc8c77 100644
--- a/package.json
+++ b/package.json
@@ -12,7 +12,7 @@
     "dev:prod": "vite --host  --mode production",
     "dev:zxh": "vite --host  --mode zxh",
     "dev:lsp": "vite --host  --mode lsp",
-    "build": "vue-tsc && vite build",
+    "build": "vue-tsc && vite build --mode production",
     "preview": "vite preview",
     "lint": "eslint .",
     "lint:fix": "eslint . --fix"
diff --git a/src/router/index.ts b/src/router/index.ts
index 294d6b2..1c3b1bb 100644
--- a/src/router/index.ts
+++ b/src/router/index.ts
@@ -4,7 +4,7 @@ import type {
 } from 'vue-router'
 import {
   createRouter,
-  createWebHistory,
+  createWebHashHistory,
 } from 'vue-router'
 import Layout from '@/layout/index.vue'
 
@@ -85,7 +85,7 @@ export const constantRoutes: Array<RouteRecordRaw> = [
 ]
 
 export const router = createRouter({
-  history: createWebHistory(),
+  history: createWebHashHistory(import.meta.env.VITE_GLOB_BASE_URL),
   routes: constantRoutes,
 })
 
diff --git a/vite.config.ts b/vite.config.ts
index 991cdc2..c948c3f 100644
--- a/vite.config.ts
+++ b/vite.config.ts
@@ -19,9 +19,6 @@ export default defineConfig({
   ],
   base: './',
   publicDir: 'public',
-  server: {
-    host: '0.0.0.0',
-  },
   resolve: {
     // 配置路径别名
     alias: {