From 8ec002300b3be6504e492d43959646d583e5b122 Mon Sep 17 00:00:00 2001 From: chy Date: Tue, 3 Mar 2026 15:04:34 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=9F=E4=B8=80=E8=BA=AB=E4=BB=BD=E8=AE=A4?= =?UTF-8?q?=E8=AF=81=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/permission.ts | 1 + src/views/Login/components/LoginForm.vue | 31 +++++++++--------------- 2 files changed, 12 insertions(+), 20 deletions(-) diff --git a/src/permission.ts b/src/permission.ts index c9cf7b0..57d445e 100644 --- a/src/permission.ts +++ b/src/permission.ts @@ -59,6 +59,7 @@ const whiteList = [ // 路由加载前 router.beforeEach(async (to, from, next) => { + debugger start() loadStart() if (getAccessToken()) { diff --git a/src/views/Login/components/LoginForm.vue b/src/views/Login/components/LoginForm.vue index 0f98f7e..a239d00 100644 --- a/src/views/Login/components/LoginForm.vue +++ b/src/views/Login/components/LoginForm.vue @@ -82,7 +82,6 @@ mode="pop" @success="handleLogin" /> - @@ -141,7 +140,6 @@ const loginData = reactive({ } }) - // 获取验证码 const getCode = async () => { // 情况一,未开启:则直接登录 @@ -174,7 +172,6 @@ const getCookie = () => { } } - // 根据域名,获得租户信息 const getTenantByWebsite = async () => { const website = location.host @@ -189,7 +186,6 @@ const loading = ref() // ElLoading.service 返回的实例 const handleLogin = async (params) => { loginLoading.value = true try { - const data = await validForm() if (!data) return @@ -210,30 +206,25 @@ const handleLogin = async (params) => { authUtil.removeLoginForm() } authUtil.setToken(res) - debugger + debugger if (!redirect.value) { - redirect.value = '/' } // 判断是否为SSO登录 if (redirect.value.indexOf('sso') !== -1) { window.location.href = window.location.href.replace('/login?redirect=', '') } else { - const queryParams = new URLSearchParams(window.location.search); - const ticketUrl = queryParams.get('url'); // 获取查询参数值,例如 ?paramName=value 中的 value - const accessToken =authUtil.getAccessToken(); - debugger - console.log(accessToken); - if(ticketUrl!=null){ - var urll=ticketUrl+"?ticket="+accessToken; - window.location.href = urll - }else{ - + const queryParams = new URLSearchParams(window.location.search) + const ticketUrl = queryParams.get('url') // 获取查询参数值,例如 ?paramName=value 中的 value + const accessToken = authUtil.getAccessToken() + debugger + console.log(accessToken) + if (ticketUrl != null) { + var urll = ticketUrl + '?ticket=' + accessToken + window.location.href = urll + } else { push({ path: redirect.value || permissionStore.addRouters[0].path }) - } - - - + } } } finally { loginLoading.value = false