Skip to content

Commit e4a8f37

Browse files
committed
refactor: chat ui
1 parent 4ba5fa3 commit e4a8f37

File tree

2 files changed

+12
-13
lines changed

2 files changed

+12
-13
lines changed

ui/src/api/chat/chat.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -98,14 +98,7 @@ const ldapLogin: (accessToken: string, request: LoginRequest, loading?: Ref<bool
9898
* @param loading 接口加载器
9999
*/
100100
const getCaptcha: (loading?: Ref<boolean>) => Promise<Result<any>> = (loading) => {
101-
return get('/user/captcha', undefined, loading)
102-
}
103-
104-
/**
105-
* 获取登录方式
106-
*/
107-
const getAuthType: (accessToken: string, loading?: Ref<boolean>) => Promise<Result<any>> = (accessToken, loading) => {
108-
return get('auth/auth/types/' + accessToken, undefined, loading)
101+
return get('/captcha', undefined, loading)
109102
}
110103

111104
/**
@@ -145,6 +138,13 @@ const getLarkCallback: (code: string, loading?: Ref<boolean>) => Promise<Result<
145138
) => {
146139
return get('lark/oauth2', {code}, loading)
147140
}
141+
142+
/**
143+
* 获取认证设置
144+
*/
145+
const getAuthSetting: (auth_type: string, loading?: Ref<boolean>) => Promise<Result<any>> = (auth_type, loading) => {
146+
return get(`/chat_user/${auth_type}/detail`, undefined, loading)
147+
}
148148
export default {
149149
open,
150150
chat,
@@ -153,12 +153,12 @@ export default {
153153
applicationProfile,
154154
login,
155155
getCaptcha,
156-
getAuthType,
157156
getDingCallback,
158157
getQrType,
159158
getWecomCallback,
160159
getDingOauth2Callback,
161160
getLarkCallback,
162161
getQrSource,
163-
ldapLogin
162+
ldapLogin,
163+
getAuthSetting
164164
}

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,7 @@ import type {FormInstance, FormRules} from 'element-plus'
132132
import type {LoginRequest} from '@/api/type/login'
133133
import LoginContainer from '@/layout/login-layout/LoginContainer.vue'
134134
import UserLoginLayout from '@/layout/login-layout/UserLoginLayout.vue'
135-
import loginApi from '@/api/chat-user/user-login.ts'
136-
import authApi from '@/api/chat-user/auth-setting'
135+
import loginApi from '@/api/chat/chat.ts'
137136
import {t, getBrowserLang} from '@/locales'
138137
import useStore from '@/stores'
139138
import {useI18n} from 'vue-i18n'
@@ -233,7 +232,7 @@ function redirectAuth(authType: string, needMessage: boolean = false) {
233232
if (authType === 'LDAP' || authType === '') {
234233
return
235234
}
236-
authApi.getAuthSetting(authType, loading).then((res: any) => {
235+
loginApi.getAuthSetting(authType, loading).then((res: any) => {
237236
if (!res.data || !res.data.config) {
238237
return;
239238
}

0 commit comments

Comments
 (0)