Browse Source

直接进入login

master
maochaoying 2 years ago
parent
commit
01739597ed
  1. 8
      .env
  2. 2
      src/components/LoginForm.vue
  3. 2
      src/pages/Home.vue
  4. 6
      src/router/index.js
  5. 2
      src/store/modules/websocket.js

8
.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/
# VITE_BASE_WS1_URL=ws://127.0.0.1:19001/
# VITE_BASE_WS2_URL=ws://127.0.0.1:19002/

2
src/components/LoginForm.vue

@ -107,7 +107,7 @@ const handleLogin = () => {
props.hideLoginModal() props.hideLoginModal()
// TAB // TAB
} else { } else {
window.location.href = 'http://127.0.0.1/'
window.location.href = 'http://127.0.0.1/#/home'
} }
} }
}) })

2
src/pages/Home.vue

@ -439,7 +439,7 @@ onBeforeUnmount(() => {
const handleLogout = () => { const handleLogout = () => {
webSocketStore?.sendCommandMsg(logoutJSON) webSocketStore?.sendCommandMsg(logoutJSON)
window.location.href = 'http://127.0.0.1/#/login'
window.location.href = 'http://127.0.0.1/#/'
} }
</script> </script>

6
src/router/index.js

@ -7,11 +7,11 @@ const Login = () => import('@/pages/Login')
const routes = [ const routes = [
{ {
path: '/', path: '/',
component: Home,
component: Login,
}, },
{ {
path: '/login',
component: Login,
path: '/home',
component: Home,
}, },
] ]

2
src/store/modules/websocket.js

@ -60,7 +60,7 @@ export const useWebSocketStore = defineStore({
replenishingFluidsWorkState, replenishingFluidsWorkState,
} = state || {} } = state || {}
if (!isLogin) { if (!isLogin) {
window.location.href = 'http://127.0.0.1/#/login'
window.location.href = 'http://127.0.0.1/#/'
return return
} }
const { const {

Loading…
Cancel
Save