diff --git a/ui/src/api/chat/chat.ts b/ui/src/api/chat/chat.ts index fcb360754..32d9dcf2b 100644 --- a/ui/src/api/chat/chat.ts +++ b/ui/src/api/chat/chat.ts @@ -98,14 +98,7 @@ const ldapLogin: (accessToken: string, request: LoginRequest, loading?: Ref) => Promise> = (loading) => { - return get('/user/captcha', undefined, loading) -} - -/** - * 获取登录方式 - */ -const getAuthType: (accessToken: string, loading?: Ref) => Promise> = (accessToken, loading) => { - return get('auth/auth/types/' + accessToken, undefined, loading) + return get('/captcha', undefined, loading) } /** @@ -145,6 +138,13 @@ const getLarkCallback: (code: string, loading?: Ref) => Promise { return get('lark/oauth2', {code}, loading) } + +/** + * 获取认证设置 + */ +const getAuthSetting: (auth_type: string, loading?: Ref) => Promise> = (auth_type, loading) => { + return get(`/chat_user/${auth_type}/detail`, undefined, loading) +} export default { open, chat, @@ -153,12 +153,12 @@ export default { applicationProfile, login, getCaptcha, - getAuthType, getDingCallback, getQrType, getWecomCallback, getDingOauth2Callback, getLarkCallback, getQrSource, - ldapLogin + ldapLogin, + getAuthSetting } diff --git a/ui/src/views/chat/user-login/index.vue b/ui/src/views/chat/user-login/index.vue index d53c898be..d7d838e94 100644 --- a/ui/src/views/chat/user-login/index.vue +++ b/ui/src/views/chat/user-login/index.vue @@ -132,8 +132,7 @@ import type {FormInstance, FormRules} from 'element-plus' import type {LoginRequest} from '@/api/type/login' import LoginContainer from '@/layout/login-layout/LoginContainer.vue' import UserLoginLayout from '@/layout/login-layout/UserLoginLayout.vue' -import loginApi from '@/api/chat-user/user-login.ts' -import authApi from '@/api/chat-user/auth-setting' +import loginApi from '@/api/chat/chat.ts' import {t, getBrowserLang} from '@/locales' import useStore from '@/stores' import {useI18n} from 'vue-i18n' @@ -233,7 +232,7 @@ function redirectAuth(authType: string, needMessage: boolean = false) { if (authType === 'LDAP' || authType === '') { return } - authApi.getAuthSetting(authType, loading).then((res: any) => { + loginApi.getAuthSetting(authType, loading).then((res: any) => { if (!res.data || !res.data.config) { return; }