refactor: chat ui

This commit is contained in:
wxg0103 2025-06-17 16:31:07 +08:00
parent 4ba5fa324a
commit e4a8f371ab
2 changed files with 12 additions and 13 deletions

View File

@ -98,14 +98,7 @@ const ldapLogin: (accessToken: string, request: LoginRequest, loading?: Ref<bool
* @param loading * @param loading
*/ */
const getCaptcha: (loading?: Ref<boolean>) => Promise<Result<any>> = (loading) => { const getCaptcha: (loading?: Ref<boolean>) => Promise<Result<any>> = (loading) => {
return get('/user/captcha', undefined, loading) return get('/captcha', undefined, loading)
}
/**
*
*/
const getAuthType: (accessToken: string, loading?: Ref<boolean>) => Promise<Result<any>> = (accessToken, loading) => {
return get('auth/auth/types/' + accessToken, undefined, loading)
} }
/** /**
@ -145,6 +138,13 @@ const getLarkCallback: (code: string, loading?: Ref<boolean>) => Promise<Result<
) => { ) => {
return get('lark/oauth2', {code}, loading) 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 { export default {
open, open,
chat, chat,
@ -153,12 +153,12 @@ export default {
applicationProfile, applicationProfile,
login, login,
getCaptcha, getCaptcha,
getAuthType,
getDingCallback, getDingCallback,
getQrType, getQrType,
getWecomCallback, getWecomCallback,
getDingOauth2Callback, getDingOauth2Callback,
getLarkCallback, getLarkCallback,
getQrSource, getQrSource,
ldapLogin ldapLogin,
getAuthSetting
} }

View File

@ -132,8 +132,7 @@ 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-user/user-login.ts' import loginApi from '@/api/chat/chat.ts'
import authApi from '@/api/chat-user/auth-setting'
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'
@ -233,7 +232,7 @@ function redirectAuth(authType: string, needMessage: boolean = false) {
if (authType === 'LDAP' || authType === '') { if (authType === 'LDAP' || authType === '') {
return return
} }
authApi.getAuthSetting(authType, loading).then((res: any) => { loginApi.getAuthSetting(authType, loading).then((res: any) => {
if (!res.data || !res.data.config) { if (!res.data || !res.data.config) {
return; return;
} }