@@ -64,7 +64,7 @@ import { useCache } from '@/utils/useCache'
6464
6565import router from ' @/router'
6666import { useUserStore } from ' @/stores/user.ts'
67- import { getQueryString , getUrlParams , isPlatformClient } from ' @/utils/utils'
67+ import { getQueryString , getSQLBotAddr , getUrlParams , isPlatformClient } from ' @/utils/utils'
6868import { loadClient , type LoginCategory } from ' ./PlatformClient'
6969// import MfaStep from './MfaStep.vue'
7070// import { logoutHandler } from '@/utils/logout'
@@ -344,8 +344,7 @@ const casLogin = () => {
344344 // logoutHandler(true, true)
345345 platformLoginMsg .value = e ?.message || e
346346 setTimeout (() => {
347- window .location .href =
348- window .location .origin + window .location .pathname + window .location .hash
347+ window .location .href = getSQLBotAddr () + window .location .hash
349348 }, 2000 )
350349 }, 1500 )
351350 })
@@ -377,8 +376,7 @@ const oauth2Login = () => {
377376 // logoutHandler(true, true)
378377 platformLoginMsg .value = e ?.message || e
379378 setTimeout (() => {
380- window .location .href =
381- window .location .origin + window .location .pathname + window .location .hash
379+ window .location .href = getSQLBotAddr () + window .location .hash
382380 }, 2000 )
383381 }, 1500 )
384382 })
@@ -410,8 +408,7 @@ const oidcLogin = () => {
410408 // logoutHandler(true, true)
411409 platformLoginMsg .value = e ?.message || e
412410 setTimeout (() => {
413- window .location .href =
414- window .location .origin + window .location .pathname + window .location .hash
411+ window .location .href = getSQLBotAddr () + window .location .hash
415412 }, 2000 )
416413 }, 1500 )
417414 })
@@ -443,15 +440,14 @@ const wecomLogin = () => {
443440 // logoutHandler(true, true)
444441 platformLoginMsg .value = e ?.message || e
445442 setTimeout (() => {
446- window .location .href =
447- window .location .origin + window .location .pathname + window .location .hash
443+ window .location .href = getSQLBotAddr () + window .location .hash
448444 }, 2000 )
449445 }, 1500 )
450446 })
451447}
452448const larkLogin = () => {
453449 const urlParams = getUrlParams ()
454- urlParams [' redirect_uri' ] = encodeURIComponent (window . location . origin + window . location . pathname )
450+ urlParams [' redirect_uri' ] = encodeURIComponent (getSQLBotAddr () )
455451 request
456452 .post (' /system/platform/sso/8' , urlParams )
457453 .then ((res : any ) => {
@@ -477,8 +473,7 @@ const larkLogin = () => {
477473 // logoutHandler(true, true)
478474 platformLoginMsg .value = e ?.message || e
479475 setTimeout (() => {
480- window .location .href =
481- window .location .origin + window .location .pathname + window .location .hash
476+ window .location .href = getSQLBotAddr () + window .location .hash
482477 }, 2000 )
483478 }, 1500 )
484479 })
@@ -510,8 +505,7 @@ const dingtalkLogin = () => {
510505 // logoutHandler(true, true)
511506 platformLoginMsg .value = e ?.message || e
512507 setTimeout (() => {
513- window .location .href =
514- window .location .origin + window .location .pathname + window .location .hash
508+ window .location .href = getSQLBotAddr () + window .location .hash
515509 }, 2000 )
516510 }, 1500 )
517511 })
@@ -536,7 +530,7 @@ const dingtalkLogin = () => {
536530 userStore.setTime(Date.now())
537531 if (origin === 10 || isLarkPlatform()) {
538532 window.location.href =
539- window.location.origin + window.location.pathname + window.location.hash
533+ getSQLBotAddr() + window.location.hash
540534 } else {
541535 const queryRedirectPath = getCurLocation()
542536 router.push({ path: queryRedirectPath })
@@ -547,7 +541,7 @@ const dingtalkLogin = () => {
547541 if (isLarkPlatform()) {
548542 setTimeout(() => {
549543 window.location.href =
550- window.location.origin + window.location.pathname + window.location.hash
544+ getSQLBotAddr() + window.location.hash
551545 }, 2000)
552546 } else {
553547 setTimeout(() => {
@@ -613,7 +607,7 @@ const oauth2Token = (cb) => {
613607 .catch(() => {
614608 setTimeout(() => {
615609 window.location.href =
616- window.location.origin + window.location.pathname + window.location.hash
610+ getSQLBotAddr() + window.location.hash
617611 }, 2000)
618612 })
619613}
0 commit comments