mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-31 02:02:48 +00:00
feat: chat user
This commit is contained in:
parent
8875bc9b83
commit
e0a7fe8feb
|
|
@ -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
|
||||
}
|
||||
|
|
@ -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,
|
||||
}
|
||||
|
|
@ -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
|
||||
}
|
||||
|
|
@ -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: '请输入用户名/邮箱',
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@
|
|||
</template>
|
||||
<script setup lang="ts">
|
||||
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 { t } from '@/locales'
|
||||
import { MsgSuccess } from '@/utils/message'
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ template
|
|||
<script setup lang="ts">
|
||||
import { reactive, ref } from 'vue'
|
||||
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 { t } from '@/locales'
|
||||
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@
|
|||
</template>
|
||||
<script setup lang="ts">
|
||||
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 { t } from '@/locales'
|
||||
import { MsgSuccess } from '@/utils/message'
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@
|
|||
</template>
|
||||
<script setup lang="ts">
|
||||
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 { t } from '@/locales'
|
||||
import { MsgSuccess } from '@/utils/message'
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@
|
|||
</template>
|
||||
<script setup lang="ts">
|
||||
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 { t } from '@/locales'
|
||||
import { MsgSuccess } from '@/utils/message'
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@
|
|||
import { reactive, ref, onMounted } from 'vue'
|
||||
import { copyClick } from '@/utils/clipboard'
|
||||
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 { t } from '@/locales'
|
||||
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
<template>
|
||||
<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="group-member p-8 border-r">
|
||||
<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">
|
||||
<AppIcon iconName="app-add-users" class="add-user-icon" />
|
||||
</el-button>
|
||||
|
|
@ -13,7 +13,7 @@
|
|||
<div class="group-member-input">
|
||||
<el-input
|
||||
v-model="filterText"
|
||||
:placeholder="$t('views.group.searchBar.placeholder')"
|
||||
:placeholder="$t('views.system.group.searchBar.placeholder')"
|
||||
prefix-icon="Search"
|
||||
clearable
|
||||
/>
|
||||
|
|
@ -40,7 +40,7 @@
|
|||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
<el-dropdown-item @click.prevent="deleteMember(row)">{{
|
||||
$t('views.group.delete.button')
|
||||
$t('views.system.group.delete.button')
|
||||
}}</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
|
|
@ -54,7 +54,7 @@
|
|||
</div>
|
||||
<div class="permission-setting flex" v-loading="rLoading">
|
||||
<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>
|
||||
|
|
|
|||
Loading…
Reference in New Issue