mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 10:02:46 +00:00
refactor: chat ui
This commit is contained in:
parent
4ba5fa324a
commit
e4a8f371ab
|
|
@ -98,14 +98,7 @@ const ldapLogin: (accessToken: string, request: LoginRequest, loading?: Ref<bool
|
|||
* @param loading 接口加载器
|
||||
*/
|
||||
const getCaptcha: (loading?: Ref<boolean>) => Promise<Result<any>> = (loading) => {
|
||||
return get('/user/captcha', undefined, loading)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取登录方式
|
||||
*/
|
||||
const getAuthType: (accessToken: string, loading?: Ref<boolean>) => Promise<Result<any>> = (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<boolean>) => Promise<Result<
|
|||
) => {
|
||||
return get('lark/oauth2', {code}, loading)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取认证设置
|
||||
*/
|
||||
const getAuthSetting: (auth_type: string, loading?: Ref<boolean>) => Promise<Result<any>> = (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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue