From 01739597edfdf24eb58848fd7315e989678063b2 Mon Sep 17 00:00:00 2001 From: maochaoying <925670706@qq.com> Date: Sun, 10 Sep 2023 19:46:15 +0800 Subject: [PATCH] =?UTF-8?q?=E7=9B=B4=E6=8E=A5=E8=BF=9B=E5=85=A5login?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env | 8 ++++---- src/components/LoginForm.vue | 2 +- src/pages/Home.vue | 2 +- src/router/index.js | 6 +++--- src/store/modules/websocket.js | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.env b/.env index c4ae906..fe3f0dd 100644 --- a/.env +++ b/.env @@ -1,5 +1,5 @@ -# VITE_BASE_WS1_URL=ws://192.168.8.10:19001/ -# VITE_BASE_WS2_URL=ws://192.168.8.10:19002/ +VITE_BASE_WS1_URL=ws://192.168.8.10:19001/ +VITE_BASE_WS2_URL=ws://192.168.8.10:19002/ -VITE_BASE_WS1_URL=ws://127.0.0.1:19001/ -VITE_BASE_WS2_URL=ws://127.0.0.1:19002/ \ No newline at end of file +# VITE_BASE_WS1_URL=ws://127.0.0.1:19001/ +# VITE_BASE_WS2_URL=ws://127.0.0.1:19002/ \ No newline at end of file diff --git a/src/components/LoginForm.vue b/src/components/LoginForm.vue index c6cd431..4ce445d 100644 --- a/src/components/LoginForm.vue +++ b/src/components/LoginForm.vue @@ -107,7 +107,7 @@ const handleLogin = () => { props.hideLoginModal() // 判断是否在消毒中,如果在消毒中,将TAB切换到设置 } else { - window.location.href = 'http://127.0.0.1/' + window.location.href = 'http://127.0.0.1/#/home' } } }) diff --git a/src/pages/Home.vue b/src/pages/Home.vue index 6401a32..e6860ad 100644 --- a/src/pages/Home.vue +++ b/src/pages/Home.vue @@ -439,7 +439,7 @@ onBeforeUnmount(() => { const handleLogout = () => { webSocketStore?.sendCommandMsg(logoutJSON) - window.location.href = 'http://127.0.0.1/#/login' + window.location.href = 'http://127.0.0.1/#/' } diff --git a/src/router/index.js b/src/router/index.js index 446bfd1..bcc13e3 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -7,11 +7,11 @@ const Login = () => import('@/pages/Login') const routes = [ { path: '/', - component: Home, + component: Login, }, { - path: '/login', - component: Login, + path: '/home', + component: Home, }, ] diff --git a/src/store/modules/websocket.js b/src/store/modules/websocket.js index b6039cc..cf44e33 100644 --- a/src/store/modules/websocket.js +++ b/src/store/modules/websocket.js @@ -60,7 +60,7 @@ export const useWebSocketStore = defineStore({ replenishingFluidsWorkState, } = state || {} if (!isLogin) { - window.location.href = 'http://127.0.0.1/#/login' + window.location.href = 'http://127.0.0.1/#/' return } const {