Skip to content

Commit 4b6f8c5

Browse files
committed
fix: After entering the password for the public access link, the parameters carried by the URL address are missing
1 parent 827c06c commit 4b6f8c5

File tree

2 files changed

+32
-24
lines changed

2 files changed

+32
-24
lines changed

ui/src/router/chat/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,13 @@ router.beforeEach(
7171
params: {
7272
accessToken: to.params.accessToken,
7373
},
74+
query: to.query,
7475
})
7576
}
7677
return
7778
}
7879
if (p_token) {
79-
next({ ...to, query: {} })
80+
next({ ...to, query: to.query })
8081
} else {
8182
next()
8283
}

ui/src/views/chat/user-login/index.vue

Lines changed: 30 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
class="mr-8"
1111
style="background: none"
1212
>
13-
<img :src="chatUser.chat_profile?.icon" alt=""/>
13+
<img :src="chatUser.chat_profile?.icon" alt="" />
1414
</el-avatar>
15-
<LogoIcon v-else height="32px" class="mr-8"/>
15+
<LogoIcon v-else height="32px" class="mr-8" />
1616
<h4>{{ chatUser.chat_profile?.application_name }}</h4>
1717
</div>
1818
</template>
@@ -29,9 +29,9 @@
2929
class="mr-8"
3030
style="background: none"
3131
>
32-
<img :src="chatUser.chat_profile?.icon" alt=""/>
32+
<img :src="chatUser.chat_profile?.icon" alt="" />
3333
</el-avatar>
34-
<LogoIcon v-else height="32px" class="mr-8"/>
34+
<LogoIcon v-else height="32px" class="mr-8" />
3535
<h4>{{ chatUser.chat_profile?.application_name }}</h4>
3636
</div>
3737
</template>
@@ -104,7 +104,7 @@
104104
</el-button>
105105
</div>
106106
<div v-if="showQrCodeTab">
107-
<QrCodeTab :tabs="orgOptions"/>
107+
<QrCodeTab :tabs="orgOptions" />
108108
</div>
109109
<div class="login-gradient-divider lighter mt-24" v-if="modeList.length > 1">
110110
<span>{{ $t('views.login.moreMethod') }}</span>
@@ -123,7 +123,7 @@
123123
'font-size': item === 'OAUTH2' ? '8px' : '10px',
124124
color: theme.themeInfo?.theme,
125125
}"
126-
>{{ item }}</span
126+
>{{ item }}</span
127127
>
128128
</el-button>
129129
<el-button
@@ -133,7 +133,7 @@
133133
class="login-button-circle color-secondary"
134134
@click="changeMode('QR_CODE')"
135135
>
136-
<img src="@/assets/scan/icon_qr_outlined.svg" width="25px"/>
136+
<img src="@/assets/scan/icon_qr_outlined.svg" width="25px" />
137137
</el-button>
138138
<el-button
139139
v-if="item === 'LOCAL' && loginMode != 'LOCAL'"
@@ -150,29 +150,29 @@
150150
</UserLoginLayout>
151151
</template>
152152
<script setup lang="ts">
153-
import {onMounted, ref, onBeforeMount} from 'vue'
154-
import {useRoute, useRouter} from 'vue-router'
155-
import type {FormInstance, FormRules} from 'element-plus'
156-
import type {LoginRequest} from '@/api/type/login'
153+
import { onMounted, ref, onBeforeMount } from 'vue'
154+
import { useRoute, useRouter } from 'vue-router'
155+
import type { FormInstance, FormRules } from 'element-plus'
156+
import type { LoginRequest } from '@/api/type/login'
157157
import LoginContainer from '@/layout/login-layout/LoginContainer.vue'
158158
import UserLoginLayout from '@/layout/login-layout/UserLoginLayout.vue'
159159
import loginApi from '@/api/chat/chat.ts'
160-
import {t, getBrowserLang} from '@/locales'
160+
import { t, getBrowserLang } from '@/locales'
161161
import useStore from '@/stores'
162-
import {useI18n} from 'vue-i18n'
162+
import { useI18n } from 'vue-i18n'
163163
import QrCodeTab from '@/views/login/scanCompinents/QrCodeTab.vue'
164-
import {MsgConfirm, MsgError} from '@/utils/message.ts'
164+
import { MsgConfirm, MsgError } from '@/utils/message.ts'
165165
import PasswordAuth from '@/views/chat/auth/component/password.vue'
166-
import {isAppIcon} from '@/utils/common'
166+
import { isAppIcon } from '@/utils/common'
167167
168168
const router = useRouter()
169-
const {theme, chatUser} = useStore()
170-
const {locale} = useI18n({useScope: 'global'})
169+
const { theme, chatUser } = useStore()
170+
const { locale } = useI18n({ useScope: 'global' })
171171
const loading = ref<boolean>(false)
172172
const route = useRoute()
173173
const identifyCode = ref<string>('')
174174
const {
175-
params: {accessToken},
175+
params: { accessToken },
176176
} = route as any
177177
const loginFormRef = ref<FormInstance>()
178178
const loginForm = ref<LoginRequest>({
@@ -209,11 +209,19 @@ const loginHandle = () => {
209209
loginFormRef.value?.validate().then(() => {
210210
if (loginMode.value === 'LDAP') {
211211
chatUser.ldapLogin(loginForm.value).then((ok) => {
212-
router.push({name: 'chat', params: {accessToken: chatUser.accessToken}})
212+
router.push({
213+
name: 'chat',
214+
params: { accessToken: chatUser.accessToken },
215+
query: route.query,
216+
})
213217
})
214218
} else {
215219
chatUser.login(loginForm.value).then((ok) => {
216-
router.push({name: 'chat', params: {accessToken: chatUser.accessToken}})
220+
router.push({
221+
name: 'chat',
222+
params: { accessToken: chatUser.accessToken },
223+
query: route.query,
224+
})
217225
})
218226
}
219227
})
@@ -292,8 +300,7 @@ function redirectAuth(authType: string, needMessage: boolean = false) {
292300
.then(() => {
293301
window.location.href = url
294302
})
295-
.catch(() => {
296-
})
303+
.catch(() => {})
297304
} else {
298305
console.log('url', url)
299306
window.location.href = url
@@ -328,7 +335,7 @@ onBeforeMount(() => {
328335
}
329336
loginMode.value = modeList.value[0] || 'LOCAL'
330337
if (!modeList.value.includes('LOCAL') && !modeList.value.includes('LDAP')) {
331-
loginMode.value = '';
338+
loginMode.value = ''
332339
}
333340
if (modeList.value.length == 1 && ['CAS', 'OIDC', 'OAuth2'].includes(modeList.value[0])) {
334341
redirectAuth(modeList.value[0])

0 commit comments

Comments
 (0)