fix: After entering the password for the public access link, the parameters carried by the URL address are missing (#3570)

This commit is contained in:
shaohuzhang1 2025-07-11 22:36:43 +08:00 committed by GitHub
parent 827c06c03f
commit 4c9d024b67
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 32 additions and 24 deletions

View File

@ -71,12 +71,13 @@ router.beforeEach(
params: {
accessToken: to.params.accessToken,
},
query: to.query,
})
}
return
}
if (p_token) {
next({ ...to, query: {} })
next({ ...to, query: to.query })
} else {
next()
}

View File

@ -209,11 +209,19 @@ const loginHandle = () => {
loginFormRef.value?.validate().then(() => {
if (loginMode.value === 'LDAP') {
chatUser.ldapLogin(loginForm.value).then((ok) => {
router.push({name: 'chat', params: {accessToken: chatUser.accessToken}})
router.push({
name: 'chat',
params: { accessToken: chatUser.accessToken },
query: route.query,
})
})
} else {
chatUser.login(loginForm.value).then((ok) => {
router.push({name: 'chat', params: {accessToken: chatUser.accessToken}})
router.push({
name: 'chat',
params: { accessToken: chatUser.accessToken },
query: route.query,
})
})
}
})
@ -292,8 +300,7 @@ function redirectAuth(authType: string, needMessage: boolean = false) {
.then(() => {
window.location.href = url
})
.catch(() => {
})
.catch(() => {})
} else {
console.log('url', url)
window.location.href = url
@ -328,7 +335,7 @@ onBeforeMount(() => {
}
loginMode.value = modeList.value[0] || 'LOCAL'
if (!modeList.value.includes('LOCAL') && !modeList.value.includes('LDAP')) {
loginMode.value = '';
loginMode.value = ''
}
if (modeList.value.length == 1 && ['CAS', 'OIDC', 'OAuth2'].includes(modeList.value[0])) {
redirectAuth(modeList.value[0])