修改统一身份认证

This commit is contained in:
chy
2026-03-02 15:13:17 +08:00
parent 76df67db6a
commit 824dd39172
2 changed files with 7 additions and 14 deletions

View File

@@ -95,26 +95,15 @@ const leftStyle = computed(() => {
linkMT: leftW / 23.87 + 'px', linkMT: leftW / 23.87 + 'px',
textMt: leftW / 16.2 + 'px' textMt: leftW / 16.2 + 'px'
} }
return { lottie, bottomText, logo } return { lottie, bottomText, logo }
}) })
onMounted(() => {
const queryParams = new URLSearchParams(window.location.search);
const paramValue = queryParams.get('url'); // 获取查询参数值,例如 ?paramName=value 中的 value
debugger
});
const newClass = computed(() => { const newClass = computed(() => {
const mobile = appStore.getMobile ? 'is-mobile' : '' const mobile = appStore.getMobile ? 'is-mobile' : ''
const toggle = appStore.getFullscreen ? 'is-toggle' : '' const toggle = appStore.getFullscreen ? 'is-toggle' : ''
return toggle ? toggle : mobile return toggle ? toggle : mobile
}) })
// const route = useRoute();
// console.log(route.query)
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

View File

@@ -97,6 +97,7 @@ import * as authUtil from '@/utils/auth'
import { usePermissionStore } from '@/store/modules/permission' import { usePermissionStore } from '@/store/modules/permission'
import * as LoginApi from '@/api/login' import * as LoginApi from '@/api/login'
import { LoginStateEnum, useFormValid, useLoginState } from './useLogin' import { LoginStateEnum, useFormValid, useLoginState } from './useLogin'
import { create } from 'domain'
defineOptions({ name: 'LoginForm' }) defineOptions({ name: 'LoginForm' })
@@ -172,6 +173,8 @@ const getCookie = () => {
} }
} }
} }
// 根据域名,获得租户信息 // 根据域名,获得租户信息
const getTenantByWebsite = async () => { const getTenantByWebsite = async () => {
const website = location.host const website = location.host
@@ -216,12 +219,13 @@ const handleLogin = async (params) => {
if (redirect.value.indexOf('sso') !== -1) { if (redirect.value.indexOf('sso') !== -1) {
window.location.href = window.location.href.replace('/login?redirect=', '') window.location.href = window.location.href.replace('/login?redirect=', '')
} else { } else {
const queryParams = new URLSearchParams(window.location.search); const queryParams = new URLSearchParams(window.location.search);
const ticketUrl = queryParams.get('url'); // 获取查询参数值,例如 ?paramName=value 中的 value const ticketUrl = queryParams.get('url'); // 获取查询参数值,例如 ?paramName=value 中的 value
console.log(ticketUrl); const accessToken =authUtil.getAccessToken();
debugger debugger
console.log(accessToken);
if(ticketUrl!=null){ if(ticketUrl!=null){
var urll=ticketUrl+"/#/login"+"?ticket=93279E3308BDBBEED946FC965017F67A"; var urll=ticketUrl+"?ticket="+accessToken;
window.location.href = urll window.location.href = urll
}else{ }else{