diff --git a/ui/src/api/system/auth.ts b/ui/src/api/system/auth.ts new file mode 100644 index 000000000..bb6f48b79 --- /dev/null +++ b/ui/src/api/system/auth.ts @@ -0,0 +1,38 @@ +import {Result} from '@/request/Result' +import {get, post, put} from '@/request/index' +import {type Ref} from 'vue' + +const prefix = '/system/auth' +/** + * 获取认证设置 + */ +const getAuthSetting: (auth_type: string, loading?: Ref) => Promise> = (auth_type, loading) => { + return get(`${prefix}/${auth_type}/detail`, undefined, loading) +} + +/** + * ldap连接测试 + */ +const postAuthSetting: (data: any, loading?: Ref) => Promise> = ( + data, + loading +) => { + return post(`${prefix}/connection`, data, undefined, loading) +} + +/** + * 修改邮箱设置 + */ +const putAuthSetting: (auth_type: string, data: any, loading?: Ref) => Promise> = ( + auth_type, + data, + loading +) => { + return put(`${prefix}/${auth_type}/info`, data, undefined, loading) +} + +export default { + getAuthSetting, + postAuthSetting, + putAuthSetting +} diff --git a/ui/src/api/system/chat-user.ts b/ui/src/api/system/chat-user.ts new file mode 100644 index 000000000..b143f90fd --- /dev/null +++ b/ui/src/api/system/chat-user.ts @@ -0,0 +1,75 @@ +import { Result } from '@/request/Result' +import { get, put, post, del } from '@/request/index' +import type { pageRequest } from '@/api/type/common' +import type { Ref } from 'vue' +import type {ResetPasswordRequest} from "@/api/type/user.ts"; + +const prefix = '/system/chat_user' +/** + * 用户分页列表 + * @query 参数 + email_or_username: string + */ +const getUserManage: ( + page: pageRequest, + email_or_username: string, + loading?: Ref, +) => Promise> = (page, email_or_username, loading) => { + return get( + `${prefix}/${page.current_page}/${page.page_size}`, + email_or_username ? { email_or_username } : undefined, + loading, + ) +} + +/** + * 删除用户 + * @param 参数 user_id, + */ +const delUserManage: (user_id: string, loading?: Ref) => Promise> = ( + user_id, + loading, +) => { + return del(`${prefix}/${user_id}`, undefined, {}, loading) +} + +/** + * 创建用户 + */ +const postUserManage: (data: any, loading?: Ref) => Promise> = ( + data, + loading, +) => { + return post(`${prefix}`, data, undefined, loading) +} + +/** + * 编辑用户 + */ +const putUserManage: ( + user_id: string, + data: any, + loading?: Ref, +) => Promise> = (user_id, data, loading) => { + return put(`${prefix}/${user_id}`, data, undefined, loading) +} + +/** + * 修改用户密码 + */ +const putUserManagePassword: ( + user_id: string, + data: any, + loading?: Ref +) => Promise> = (user_id, data, loading) => { + return put(`${prefix}/${user_id}/re_password`, data, undefined, loading) +} + + +export default { + getUserManage, + putUserManage, + delUserManage, + postUserManage, + putUserManagePassword, +} diff --git a/ui/src/api/system/platform-source.ts b/ui/src/api/system/platform-source.ts new file mode 100644 index 000000000..fe234e71d --- /dev/null +++ b/ui/src/api/system/platform-source.ts @@ -0,0 +1,27 @@ +import { Result } from '@/request/Result' +import { get, post, del, put } from '@/request/index' +import { type Ref } from 'vue' + +const prefix = '/platform' +const getPlatformInfo: (loading?: Ref) => Promise> = (loading) => { + return get(`${prefix}/source`, undefined, loading) +} + +const updateConfig: (data: any, loading?: Ref) => Promise> = ( + data, + loading +) => { + return post(`${prefix}/source`, data, undefined, loading) +} + +const validateConnection: (data: any, loading?: Ref) => Promise> = ( + data, + loading +) => { + return put(`${prefix}/source`, data, undefined, loading) +} +export default { + getPlatformInfo, + updateConfig, + validateConnection +} diff --git a/ui/src/locales/lang/zh-CN/views/system.ts b/ui/src/locales/lang/zh-CN/views/system.ts index 09ad7e76d..6fb85f4b8 100644 --- a/ui/src/locales/lang/zh-CN/views/system.ts +++ b/ui/src/locales/lang/zh-CN/views/system.ts @@ -4,7 +4,7 @@ export default { shared: '共享', shared_resources: '共享资源', share_knowledge: '共享知识库', - authorized_workspace:'授权工作空间', + authorized_workspace: '授权工作空间', test: '测试连接', testSuccess: '测试连接成功', testFailed: '测试连接失败', @@ -23,7 +23,7 @@ export default { ldap_filterPlaceholder: '请输入用户过滤器', ldap_mapping: 'LDAP 属性映射', ldap_mappingPlaceholder: '请输入 LDAP 属性映射', - enableAuthentication: '启用 LDAP 认证' + enableAuthentication: '启用 LDAP 认证', }, cas: { title: 'CAS', @@ -33,7 +33,7 @@ export default { validateUrlPlaceholder: '请输入验证地址', redirectUrl: '回调地址', redirectUrlPlaceholder: '请输入回调地址', - enableAuthentication: '启用 CAS 认证' + enableAuthentication: '启用 CAS 认证', }, oidc: { title: 'OIDC', @@ -52,7 +52,7 @@ export default { logoutEndpointPlaceholder: '请输入注销端地址', redirectUrl: '回调地址', redirectUrlPlaceholder: '请输入回调地址', - enableAuthentication: '启用 OIDC 认证' + enableAuthentication: '启用 OIDC 认证', }, oauth2: { @@ -73,7 +73,7 @@ export default { redirectUrlPlaceholder: '请输入回调地址', filedMapping: '字段映射', filedMappingPlaceholder: '请输入字段映射', - enableAuthentication: '启用 OAuth2 认证' + enableAuthentication: '启用 OAuth2 认证', }, scanTheQRCode: { title: '扫码登录', @@ -95,8 +95,8 @@ export default { larkQrCode: '飞书扫码登录', dingtalkQrCode: '钉钉扫码登录', setting: '设置', - access: '接入' - } + access: '接入', + }, }, theme: { title: '外观设置', @@ -136,7 +136,7 @@ export default { abandonUpdate: '放弃更新', saveAndApply: '保存并应用', fileMessageError: '文件大小超过 10M', - saveSuccess: '外观设置成功' + saveSuccess: '外观设置成功', }, email: { title: '邮箱设置', @@ -151,6 +151,34 @@ export default { smtpPassword: '发件人密码', smtpPasswordPlaceholder: '请输入发件人密码', enableSSL: '启用 SSL(如果 SMTP 端口是 465,通常需要启用 SSL)', - enableTLS: '启用 TLS(如果 SMTP 端口是 587,通常需要启用 TLS)' - } + enableTLS: '启用 TLS(如果 SMTP 端口是 587,通常需要启用 TLS)', + }, + group: { + title: '团队成员', + member: '成员', + manage: '所有者', + permissionSetting: '权限设置', + addMember: '添加成员', + addSubTitle: '成员登录后可以访问到您授权的数据。', + searchBar: { + placeholder: '请输入用户名搜索', + }, + delete: { + button: '移除', + confirmTitle: '是否移除成员:', + confirmMessage: '移除后将会取消成员拥有的知识库和应用权限。', + }, + setting: { + management: '管理', + check: '查看', + }, + + form: { + userName: { + label: '用户名/邮箱', + placeholder: '请输入成员的用户名或邮箱', + requiredMessage: '请输入用户名/邮箱', + }, + }, + }, } diff --git a/ui/src/views/system-chat-user/authentication/component/CAS.vue b/ui/src/views/system-chat-user/authentication/component/CAS.vue index f870b9138..f5f9aa7b2 100644 --- a/ui/src/views/system-chat-user/authentication/component/CAS.vue +++ b/ui/src/views/system-chat-user/authentication/component/CAS.vue @@ -54,7 +54,7 @@