feat: chat user

This commit is contained in:
wangdan-fit2cloud 2025-06-12 18:34:28 +08:00
parent 8875bc9b83
commit e0a7fe8feb
11 changed files with 189 additions and 21 deletions

38
ui/src/api/system/auth.ts Normal file
View File

@ -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<boolean>) => Promise<Result<any>> = (auth_type, loading) => {
return get(`${prefix}/${auth_type}/detail`, undefined, loading)
}
/**
* ldap连接测试
*/
const postAuthSetting: (data: any, loading?: Ref<boolean>) => Promise<Result<any>> = (
data,
loading
) => {
return post(`${prefix}/connection`, data, undefined, loading)
}
/**
*
*/
const putAuthSetting: (auth_type: string, data: any, loading?: Ref<boolean>) => Promise<Result<any>> = (
auth_type,
data,
loading
) => {
return put(`${prefix}/${auth_type}/info`, data, undefined, loading)
}
export default {
getAuthSetting,
postAuthSetting,
putAuthSetting
}

View File

@ -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<boolean>,
) => Promise<Result<any>> = (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<boolean>) => Promise<Result<boolean>> = (
user_id,
loading,
) => {
return del(`${prefix}/${user_id}`, undefined, {}, loading)
}
/**
*
*/
const postUserManage: (data: any, loading?: Ref<boolean>) => Promise<Result<any>> = (
data,
loading,
) => {
return post(`${prefix}`, data, undefined, loading)
}
/**
*
*/
const putUserManage: (
user_id: string,
data: any,
loading?: Ref<boolean>,
) => Promise<Result<any>> = (user_id, data, loading) => {
return put(`${prefix}/${user_id}`, data, undefined, loading)
}
/**
*
*/
const putUserManagePassword: (
user_id: string,
data: any,
loading?: Ref<boolean>
) => Promise<Result<any>> = (user_id, data, loading) => {
return put(`${prefix}/${user_id}/re_password`, data, undefined, loading)
}
export default {
getUserManage,
putUserManage,
delUserManage,
postUserManage,
putUserManagePassword,
}

View File

@ -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<boolean>) => Promise<Result<any>> = (loading) => {
return get(`${prefix}/source`, undefined, loading)
}
const updateConfig: (data: any, loading?: Ref<boolean>) => Promise<Result<any>> = (
data,
loading
) => {
return post(`${prefix}/source`, data, undefined, loading)
}
const validateConnection: (data: any, loading?: Ref<boolean>) => Promise<Result<any>> = (
data,
loading
) => {
return put(`${prefix}/source`, data, undefined, loading)
}
export default {
getPlatformInfo,
updateConfig,
validateConnection
}

View File

@ -4,7 +4,7 @@ export default {
shared: '共享', shared: '共享',
shared_resources: '共享资源', shared_resources: '共享资源',
share_knowledge: '共享知识库', share_knowledge: '共享知识库',
authorized_workspace:'授权工作空间', authorized_workspace: '授权工作空间',
test: '测试连接', test: '测试连接',
testSuccess: '测试连接成功', testSuccess: '测试连接成功',
testFailed: '测试连接失败', testFailed: '测试连接失败',
@ -23,7 +23,7 @@ export default {
ldap_filterPlaceholder: '请输入用户过滤器', ldap_filterPlaceholder: '请输入用户过滤器',
ldap_mapping: 'LDAP 属性映射', ldap_mapping: 'LDAP 属性映射',
ldap_mappingPlaceholder: '请输入 LDAP 属性映射', ldap_mappingPlaceholder: '请输入 LDAP 属性映射',
enableAuthentication: '启用 LDAP 认证' enableAuthentication: '启用 LDAP 认证',
}, },
cas: { cas: {
title: 'CAS', title: 'CAS',
@ -33,7 +33,7 @@ export default {
validateUrlPlaceholder: '请输入验证地址', validateUrlPlaceholder: '请输入验证地址',
redirectUrl: '回调地址', redirectUrl: '回调地址',
redirectUrlPlaceholder: '请输入回调地址', redirectUrlPlaceholder: '请输入回调地址',
enableAuthentication: '启用 CAS 认证' enableAuthentication: '启用 CAS 认证',
}, },
oidc: { oidc: {
title: 'OIDC', title: 'OIDC',
@ -52,7 +52,7 @@ export default {
logoutEndpointPlaceholder: '请输入注销端地址', logoutEndpointPlaceholder: '请输入注销端地址',
redirectUrl: '回调地址', redirectUrl: '回调地址',
redirectUrlPlaceholder: '请输入回调地址', redirectUrlPlaceholder: '请输入回调地址',
enableAuthentication: '启用 OIDC 认证' enableAuthentication: '启用 OIDC 认证',
}, },
oauth2: { oauth2: {
@ -73,7 +73,7 @@ export default {
redirectUrlPlaceholder: '请输入回调地址', redirectUrlPlaceholder: '请输入回调地址',
filedMapping: '字段映射', filedMapping: '字段映射',
filedMappingPlaceholder: '请输入字段映射', filedMappingPlaceholder: '请输入字段映射',
enableAuthentication: '启用 OAuth2 认证' enableAuthentication: '启用 OAuth2 认证',
}, },
scanTheQRCode: { scanTheQRCode: {
title: '扫码登录', title: '扫码登录',
@ -95,8 +95,8 @@ export default {
larkQrCode: '飞书扫码登录', larkQrCode: '飞书扫码登录',
dingtalkQrCode: '钉钉扫码登录', dingtalkQrCode: '钉钉扫码登录',
setting: '设置', setting: '设置',
access: '接入' access: '接入',
} },
}, },
theme: { theme: {
title: '外观设置', title: '外观设置',
@ -136,7 +136,7 @@ export default {
abandonUpdate: '放弃更新', abandonUpdate: '放弃更新',
saveAndApply: '保存并应用', saveAndApply: '保存并应用',
fileMessageError: '文件大小超过 10M', fileMessageError: '文件大小超过 10M',
saveSuccess: '外观设置成功' saveSuccess: '外观设置成功',
}, },
email: { email: {
title: '邮箱设置', title: '邮箱设置',
@ -151,6 +151,34 @@ export default {
smtpPassword: '发件人密码', smtpPassword: '发件人密码',
smtpPasswordPlaceholder: '请输入发件人密码', smtpPasswordPlaceholder: '请输入发件人密码',
enableSSL: '启用 SSL如果 SMTP 端口是 465通常需要启用 SSL', 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: '请输入用户名/邮箱',
},
},
},
} }

View File

@ -54,7 +54,7 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { reactive, ref, watch, onMounted } from 'vue' import { reactive, ref, watch, onMounted } from 'vue'
import authApi from '@/api/system-settings/auth-setting' import authApi from '@/api/system/auth'
import type { FormInstance, FormRules } from 'element-plus' import type { FormInstance, FormRules } from 'element-plus'
import { t } from '@/locales' import { t } from '@/locales'
import { MsgSuccess } from '@/utils/message' import { MsgSuccess } from '@/utils/message'

View File

@ -52,7 +52,7 @@ template
<script setup lang="ts"> <script setup lang="ts">
import { reactive, ref } from 'vue' import { reactive, ref } from 'vue'
import { ElForm } from 'element-plus' import { ElForm } from 'element-plus'
import platformApi from '@/api/system-settings/platform-source' import platformApi from '@/api/system/platform-source'
import { MsgError, MsgSuccess } from '@/utils/message' import { MsgError, MsgSuccess } from '@/utils/message'
import { t } from '@/locales' import { t } from '@/locales'

View File

@ -79,7 +79,7 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { reactive, ref, watch, onMounted } from 'vue' import { reactive, ref, watch, onMounted } from 'vue'
import authApi from '@/api/system-settings/auth-setting' import authApi from '@/api/system/auth'
import type { FormInstance, FormRules } from 'element-plus' import type { FormInstance, FormRules } from 'element-plus'
import { t } from '@/locales' import { t } from '@/locales'
import { MsgSuccess } from '@/utils/message' import { MsgSuccess } from '@/utils/message'

View File

@ -100,7 +100,7 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { reactive, ref, onMounted } from 'vue' import { reactive, ref, onMounted } from 'vue'
import authApi from '@/api/system-settings/auth-setting' import authApi from '@/api/system/auth'
import type { FormInstance, FormRules } from 'element-plus' import type { FormInstance, FormRules } from 'element-plus'
import { t } from '@/locales' import { t } from '@/locales'
import { MsgSuccess } from '@/utils/message' import { MsgSuccess } from '@/utils/message'

View File

@ -97,7 +97,7 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { reactive, ref, watch, onMounted } from 'vue' import { reactive, ref, watch, onMounted } from 'vue'
import authApi from '@/api/system-settings/auth-setting' import authApi from '@/api/system/auth'
import type { FormInstance, FormRules } from 'element-plus' import type { FormInstance, FormRules } from 'element-plus'
import { t } from '@/locales' import { t } from '@/locales'
import { MsgSuccess } from '@/utils/message' import { MsgSuccess } from '@/utils/message'

View File

@ -89,7 +89,7 @@
import { reactive, ref, onMounted } from 'vue' import { reactive, ref, onMounted } from 'vue'
import { copyClick } from '@/utils/clipboard' import { copyClick } from '@/utils/clipboard'
import EditModel from './EditModal.vue' import EditModel from './EditModal.vue'
import platformApi from '@/api/system-settings/platform-source' import platformApi from '@/api/system/platform-source'
import { MsgError, MsgSuccess } from '@/utils/message' import { MsgError, MsgSuccess } from '@/utils/message'
import { t } from '@/locales' import { t } from '@/locales'

View File

@ -1,11 +1,11 @@
<template> <template>
<div class="group-manage p-16-24"> <div class="group-manage p-16-24">
<h4 class="mb-16">{{ $t('views.group.title') }}</h4> <h4 class="mb-16">{{ $t('views.system.group.title') }}</h4>
<div class="flex main-calc-height"> <div class="flex main-calc-height">
<div class="group-member p-8 border-r"> <div class="group-member p-8 border-r">
<div class="flex-between p-16"> <div class="flex-between p-16">
<h4>{{ $t('views.group.member') }}</h4> <h4>{{ $t('views.system.group.member') }}</h4>
<el-button type="primary" link @click="addMember"> <el-button type="primary" link @click="addMember">
<AppIcon iconName="app-add-users" class="add-user-icon" /> <AppIcon iconName="app-add-users" class="add-user-icon" />
</el-button> </el-button>
@ -13,7 +13,7 @@
<div class="group-member-input"> <div class="group-member-input">
<el-input <el-input
v-model="filterText" v-model="filterText"
:placeholder="$t('views.group.searchBar.placeholder')" :placeholder="$t('views.system.group.searchBar.placeholder')"
prefix-icon="Search" prefix-icon="Search"
clearable clearable
/> />
@ -40,7 +40,7 @@
<template #dropdown> <template #dropdown>
<el-dropdown-menu> <el-dropdown-menu>
<el-dropdown-item @click.prevent="deleteMember(row)">{{ <el-dropdown-item @click.prevent="deleteMember(row)">{{
$t('views.group.delete.button') $t('views.system.group.delete.button')
}}</el-dropdown-item> }}</el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</template> </template>
@ -54,7 +54,7 @@
</div> </div>
<div class="permission-setting flex" v-loading="rLoading"> <div class="permission-setting flex" v-loading="rLoading">
<div class="group-manage__table"> <div class="group-manage__table">
<h4 class="p-24 pb-0 mb-4">{{ $t('views.group.permissionSetting') }}</h4> <h4 class="p-24 pb-0 mb-4">{{ $t('views.system.group.permissionSetting') }}</h4>
</div> </div>
</div> </div>
</div> </div>