From 7b26e627879dfcf60fa6467a0d406cef02c2cca8 Mon Sep 17 00:00:00 2001 From: yuping <82253452@qq.com> Date: Mon, 16 Jan 2023 14:40:02 +0800 Subject: [PATCH] =?UTF-8?q?init=20=E7=99=BB=E5=BD=95=E8=B7=B3=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/index.js | 7 +++++-- src/views/login/login.vue | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/router/index.js b/src/router/index.js index ddcdb70..2728bca 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -18,8 +18,11 @@ const router = createRouter({ }) router.beforeEach((to, from, next) => { if (!getCookie('token')) { - to.path.includes('/login') ? next() : next({path: '/login', query: {returnUrl: to.fullPath}}) - return + if (import.meta.env.MODE === "development" || import.meta.env.MODE === "test") { + to.path.includes('/login') ? next() : next({path: '/login', query: {returnUrl: to.fullPath}}) + }else { + window.location.href = import.meta.env.VITE_BASE_LOGIN_URL + import.meta.env.VITE_BASE+to.fullPath + } } next() }) diff --git a/src/views/login/login.vue b/src/views/login/login.vue index ab1b8ea..68b9bf6 100644 --- a/src/views/login/login.vue +++ b/src/views/login/login.vue @@ -61,7 +61,7 @@ const returnclick = () => { }; const form = ref({ - account: "00004409", + account: "10181457", password: "1234567890Aa", });