|
10 | 10 | class="mr-8" |
11 | 11 | style="background: none" |
12 | 12 | > |
13 | | - <img :src="chatUser.chat_profile?.icon" alt=""/> |
| 13 | + <img :src="chatUser.chat_profile?.icon" alt="" /> |
14 | 14 | </el-avatar> |
15 | | - <LogoIcon v-else height="32px" class="mr-8"/> |
| 15 | + <LogoIcon v-else height="32px" class="mr-8" /> |
16 | 16 | <h4>{{ chatUser.chat_profile?.application_name }}</h4> |
17 | 17 | </div> |
18 | 18 | </template> |
|
29 | 29 | class="mr-8" |
30 | 30 | style="background: none" |
31 | 31 | > |
32 | | - <img :src="chatUser.chat_profile?.icon" alt=""/> |
| 32 | + <img :src="chatUser.chat_profile?.icon" alt="" /> |
33 | 33 | </el-avatar> |
34 | | - <LogoIcon v-else height="32px" class="mr-8"/> |
| 34 | + <LogoIcon v-else height="32px" class="mr-8" /> |
35 | 35 | <h4>{{ chatUser.chat_profile?.application_name }}</h4> |
36 | 36 | </div> |
37 | 37 | </template> |
|
104 | 104 | </el-button> |
105 | 105 | </div> |
106 | 106 | <div v-if="showQrCodeTab"> |
107 | | - <QrCodeTab :tabs="orgOptions"/> |
| 107 | + <QrCodeTab :tabs="orgOptions" /> |
108 | 108 | </div> |
109 | 109 | <div class="login-gradient-divider lighter mt-24" v-if="modeList.length > 1"> |
110 | 110 | <span>{{ $t('views.login.moreMethod') }}</span> |
|
123 | 123 | 'font-size': item === 'OAUTH2' ? '8px' : '10px', |
124 | 124 | color: theme.themeInfo?.theme, |
125 | 125 | }" |
126 | | - >{{ item }}</span |
| 126 | + >{{ item }}</span |
127 | 127 | > |
128 | 128 | </el-button> |
129 | 129 | <el-button |
|
133 | 133 | class="login-button-circle color-secondary" |
134 | 134 | @click="changeMode('QR_CODE')" |
135 | 135 | > |
136 | | - <img src="@/assets/scan/icon_qr_outlined.svg" width="25px"/> |
| 136 | + <img src="@/assets/scan/icon_qr_outlined.svg" width="25px" /> |
137 | 137 | </el-button> |
138 | 138 | <el-button |
139 | 139 | v-if="item === 'LOCAL' && loginMode != 'LOCAL'" |
|
150 | 150 | </UserLoginLayout> |
151 | 151 | </template> |
152 | 152 | <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' |
157 | 157 | import LoginContainer from '@/layout/login-layout/LoginContainer.vue' |
158 | 158 | import UserLoginLayout from '@/layout/login-layout/UserLoginLayout.vue' |
159 | 159 | import loginApi from '@/api/chat/chat.ts' |
160 | | -import {t, getBrowserLang} from '@/locales' |
| 160 | +import { t, getBrowserLang } from '@/locales' |
161 | 161 | import useStore from '@/stores' |
162 | | -import {useI18n} from 'vue-i18n' |
| 162 | +import { useI18n } from 'vue-i18n' |
163 | 163 | import QrCodeTab from '@/views/login/scanCompinents/QrCodeTab.vue' |
164 | | -import {MsgConfirm, MsgError} from '@/utils/message.ts' |
| 164 | +import { MsgConfirm, MsgError } from '@/utils/message.ts' |
165 | 165 | import PasswordAuth from '@/views/chat/auth/component/password.vue' |
166 | | -import {isAppIcon} from '@/utils/common' |
| 166 | +import { isAppIcon } from '@/utils/common' |
167 | 167 |
|
168 | 168 | 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' }) |
171 | 171 | const loading = ref<boolean>(false) |
172 | 172 | const route = useRoute() |
173 | 173 | const identifyCode = ref<string>('') |
174 | 174 | const { |
175 | | - params: {accessToken}, |
| 175 | + params: { accessToken }, |
176 | 176 | } = route as any |
177 | 177 | const loginFormRef = ref<FormInstance>() |
178 | 178 | const loginForm = ref<LoginRequest>({ |
@@ -209,11 +209,19 @@ const loginHandle = () => { |
209 | 209 | loginFormRef.value?.validate().then(() => { |
210 | 210 | if (loginMode.value === 'LDAP') { |
211 | 211 | 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 | + }) |
213 | 217 | }) |
214 | 218 | } else { |
215 | 219 | 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 | + }) |
217 | 225 | }) |
218 | 226 | } |
219 | 227 | }) |
@@ -292,8 +300,7 @@ function redirectAuth(authType: string, needMessage: boolean = false) { |
292 | 300 | .then(() => { |
293 | 301 | window.location.href = url |
294 | 302 | }) |
295 | | - .catch(() => { |
296 | | - }) |
| 303 | + .catch(() => {}) |
297 | 304 | } else { |
298 | 305 | console.log('url', url) |
299 | 306 | window.location.href = url |
@@ -328,7 +335,7 @@ onBeforeMount(() => { |
328 | 335 | } |
329 | 336 | loginMode.value = modeList.value[0] || 'LOCAL' |
330 | 337 | if (!modeList.value.includes('LOCAL') && !modeList.value.includes('LDAP')) { |
331 | | - loginMode.value = ''; |
| 338 | + loginMode.value = '' |
332 | 339 | } |
333 | 340 | if (modeList.value.length == 1 && ['CAS', 'OIDC', 'OAuth2'].includes(modeList.value[0])) { |
334 | 341 | redirectAuth(modeList.value[0]) |
|
0 commit comments