From 8570c0c0c15e8c18b04c22a53c13d785995988c6 Mon Sep 17 00:00:00 2001 From: 13218645326 Date: Sun, 10 Dec 2023 02:30:17 +0800 Subject: [PATCH] =?UTF-8?q?=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- env/.env.dev | 3 ++- src/router/index.ts | 8 +++----- src/views/Login.vue | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/env/.env.dev b/env/.env.dev index 891cf15..68af11f 100644 --- a/env/.env.dev +++ b/env/.env.dev @@ -5,5 +5,6 @@ VITE_BUILD_MODE = 'dev' # 开发环境接口地址 VITE_API_URL = '/proxyApi' -VITE_proxyTarget = 'http://10.40.92.16:9502' +# VITE_proxyTarget = 'http://10.40.92.16:8080' +VITE_proxyTarget = 'http://10.40.92.186:8080' # 9502 9206 \ No newline at end of file diff --git a/src/router/index.ts b/src/router/index.ts index 9c584c4..043ef35 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -279,13 +279,11 @@ const router = createRouter({ router.beforeEach((to, from, next) => { const store = useStore() - - /* if (store.token || to.path == '/login') { + if (store.token || to.path == '/Login') { next() } else { - next('/login') - } */ - next() + next('/Login') + } // chrome document.body.scrollTop = 0; // firefox 兼容火狐 diff --git a/src/views/Login.vue b/src/views/Login.vue index 640c272..4aefbcd 100644 --- a/src/views/Login.vue +++ b/src/views/Login.vue @@ -22,7 +22,7 @@ } userStore.setToken(res.data.access_token) // 跳转登录页面 - router.push('/home') + router.push('/') }