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:
parent
827c06c03f
commit
4c9d024b67
@ -71,12 +71,13 @@ router.beforeEach(
|
|||||||
params: {
|
params: {
|
||||||
accessToken: to.params.accessToken,
|
accessToken: to.params.accessToken,
|
||||||
},
|
},
|
||||||
|
query: to.query,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (p_token) {
|
if (p_token) {
|
||||||
next({ ...to, query: {} })
|
next({ ...to, query: to.query })
|
||||||
} else {
|
} else {
|
||||||
next()
|
next()
|
||||||
}
|
}
|
||||||
|
|||||||
@ -10,9 +10,9 @@
|
|||||||
class="mr-8"
|
class="mr-8"
|
||||||
style="background: none"
|
style="background: none"
|
||||||
>
|
>
|
||||||
<img :src="chatUser.chat_profile?.icon" alt=""/>
|
<img :src="chatUser.chat_profile?.icon" alt="" />
|
||||||
</el-avatar>
|
</el-avatar>
|
||||||
<LogoIcon v-else height="32px" class="mr-8"/>
|
<LogoIcon v-else height="32px" class="mr-8" />
|
||||||
<h4>{{ chatUser.chat_profile?.application_name }}</h4>
|
<h4>{{ chatUser.chat_profile?.application_name }}</h4>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -29,9 +29,9 @@
|
|||||||
class="mr-8"
|
class="mr-8"
|
||||||
style="background: none"
|
style="background: none"
|
||||||
>
|
>
|
||||||
<img :src="chatUser.chat_profile?.icon" alt=""/>
|
<img :src="chatUser.chat_profile?.icon" alt="" />
|
||||||
</el-avatar>
|
</el-avatar>
|
||||||
<LogoIcon v-else height="32px" class="mr-8"/>
|
<LogoIcon v-else height="32px" class="mr-8" />
|
||||||
<h4>{{ chatUser.chat_profile?.application_name }}</h4>
|
<h4>{{ chatUser.chat_profile?.application_name }}</h4>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -104,7 +104,7 @@
|
|||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="showQrCodeTab">
|
<div v-if="showQrCodeTab">
|
||||||
<QrCodeTab :tabs="orgOptions"/>
|
<QrCodeTab :tabs="orgOptions" />
|
||||||
</div>
|
</div>
|
||||||
<div class="login-gradient-divider lighter mt-24" v-if="modeList.length > 1">
|
<div class="login-gradient-divider lighter mt-24" v-if="modeList.length > 1">
|
||||||
<span>{{ $t('views.login.moreMethod') }}</span>
|
<span>{{ $t('views.login.moreMethod') }}</span>
|
||||||
@ -123,7 +123,7 @@
|
|||||||
'font-size': item === 'OAUTH2' ? '8px' : '10px',
|
'font-size': item === 'OAUTH2' ? '8px' : '10px',
|
||||||
color: theme.themeInfo?.theme,
|
color: theme.themeInfo?.theme,
|
||||||
}"
|
}"
|
||||||
>{{ item }}</span
|
>{{ item }}</span
|
||||||
>
|
>
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
@ -133,7 +133,7 @@
|
|||||||
class="login-button-circle color-secondary"
|
class="login-button-circle color-secondary"
|
||||||
@click="changeMode('QR_CODE')"
|
@click="changeMode('QR_CODE')"
|
||||||
>
|
>
|
||||||
<img src="@/assets/scan/icon_qr_outlined.svg" width="25px"/>
|
<img src="@/assets/scan/icon_qr_outlined.svg" width="25px" />
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
v-if="item === 'LOCAL' && loginMode != 'LOCAL'"
|
v-if="item === 'LOCAL' && loginMode != 'LOCAL'"
|
||||||
@ -150,29 +150,29 @@
|
|||||||
</UserLoginLayout>
|
</UserLoginLayout>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import {onMounted, ref, onBeforeMount} from 'vue'
|
import { onMounted, ref, onBeforeMount } from 'vue'
|
||||||
import {useRoute, useRouter} from 'vue-router'
|
import { useRoute, useRouter } from 'vue-router'
|
||||||
import type {FormInstance, FormRules} from 'element-plus'
|
import type { FormInstance, FormRules } from 'element-plus'
|
||||||
import type {LoginRequest} from '@/api/type/login'
|
import type { LoginRequest } from '@/api/type/login'
|
||||||
import LoginContainer from '@/layout/login-layout/LoginContainer.vue'
|
import LoginContainer from '@/layout/login-layout/LoginContainer.vue'
|
||||||
import UserLoginLayout from '@/layout/login-layout/UserLoginLayout.vue'
|
import UserLoginLayout from '@/layout/login-layout/UserLoginLayout.vue'
|
||||||
import loginApi from '@/api/chat/chat.ts'
|
import loginApi from '@/api/chat/chat.ts'
|
||||||
import {t, getBrowserLang} from '@/locales'
|
import { t, getBrowserLang } from '@/locales'
|
||||||
import useStore from '@/stores'
|
import useStore from '@/stores'
|
||||||
import {useI18n} from 'vue-i18n'
|
import { useI18n } from 'vue-i18n'
|
||||||
import QrCodeTab from '@/views/login/scanCompinents/QrCodeTab.vue'
|
import QrCodeTab from '@/views/login/scanCompinents/QrCodeTab.vue'
|
||||||
import {MsgConfirm, MsgError} from '@/utils/message.ts'
|
import { MsgConfirm, MsgError } from '@/utils/message.ts'
|
||||||
import PasswordAuth from '@/views/chat/auth/component/password.vue'
|
import PasswordAuth from '@/views/chat/auth/component/password.vue'
|
||||||
import {isAppIcon} from '@/utils/common'
|
import { isAppIcon } from '@/utils/common'
|
||||||
|
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const {theme, chatUser} = useStore()
|
const { theme, chatUser } = useStore()
|
||||||
const {locale} = useI18n({useScope: 'global'})
|
const { locale } = useI18n({ useScope: 'global' })
|
||||||
const loading = ref<boolean>(false)
|
const loading = ref<boolean>(false)
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const identifyCode = ref<string>('')
|
const identifyCode = ref<string>('')
|
||||||
const {
|
const {
|
||||||
params: {accessToken},
|
params: { accessToken },
|
||||||
} = route as any
|
} = route as any
|
||||||
const loginFormRef = ref<FormInstance>()
|
const loginFormRef = ref<FormInstance>()
|
||||||
const loginForm = ref<LoginRequest>({
|
const loginForm = ref<LoginRequest>({
|
||||||
@ -209,11 +209,19 @@ const loginHandle = () => {
|
|||||||
loginFormRef.value?.validate().then(() => {
|
loginFormRef.value?.validate().then(() => {
|
||||||
if (loginMode.value === 'LDAP') {
|
if (loginMode.value === 'LDAP') {
|
||||||
chatUser.ldapLogin(loginForm.value).then((ok) => {
|
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 {
|
} else {
|
||||||
chatUser.login(loginForm.value).then((ok) => {
|
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(() => {
|
.then(() => {
|
||||||
window.location.href = url
|
window.location.href = url
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {})
|
||||||
})
|
|
||||||
} else {
|
} else {
|
||||||
console.log('url', url)
|
console.log('url', url)
|
||||||
window.location.href = url
|
window.location.href = url
|
||||||
@ -328,7 +335,7 @@ onBeforeMount(() => {
|
|||||||
}
|
}
|
||||||
loginMode.value = modeList.value[0] || 'LOCAL'
|
loginMode.value = modeList.value[0] || 'LOCAL'
|
||||||
if (!modeList.value.includes('LOCAL') && !modeList.value.includes('LDAP')) {
|
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])) {
|
if (modeList.value.length == 1 && ['CAS', 'OIDC', 'OAuth2'].includes(modeList.value[0])) {
|
||||||
redirectAuth(modeList.value[0])
|
redirectAuth(modeList.value[0])
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user