fix: Uploading attachments for conversation allows for direct conversation
This commit is contained in:
parent
ecd019aa14
commit
cbf7dd00cf
@ -80,6 +80,26 @@ const putAccessToken: (
|
|||||||
return put(`${prefix}/${application_id}/access_token`, data, undefined, loading)
|
return put(`${prefix}/${application_id}/access_token`, data, undefined, loading)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 替换社区版-修改AccessToken
|
||||||
|
* @param 参数 application_id
|
||||||
|
* data {
|
||||||
|
* "show_source": boolean,
|
||||||
|
* "show_history": boolean,
|
||||||
|
* "draggable": boolean,
|
||||||
|
* "show_guide": boolean,
|
||||||
|
* "avatar": file,
|
||||||
|
* "float_icon": file,
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
const putXpackAccessToken: (
|
||||||
|
application_id: string,
|
||||||
|
data: any,
|
||||||
|
loading?: Ref<boolean>,
|
||||||
|
) => Promise<Result<any>> = (application_id, data, loading) => {
|
||||||
|
return put(`${prefix}/${application_id}/setting`, data, undefined, loading)
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 统计
|
* 统计
|
||||||
* @param 参数 application_id, data
|
* @param 参数 application_id, data
|
||||||
@ -282,4 +302,5 @@ export default {
|
|||||||
postTextToSpeech,
|
postTextToSpeech,
|
||||||
speechToText,
|
speechToText,
|
||||||
getMcpTools,
|
getMcpTools,
|
||||||
|
putXpackAccessToken
|
||||||
}
|
}
|
||||||
|
|||||||
@ -454,6 +454,8 @@ const uploadFile = async (file: any, fileList: any) => {
|
|||||||
})
|
})
|
||||||
if (!inputValue.value && uploadImageList.value.length > 0) {
|
if (!inputValue.value && uploadImageList.value.length > 0) {
|
||||||
inputValue.value = t('chat.uploadFile.imageMessage')
|
inputValue.value = t('chat.uploadFile.imageMessage')
|
||||||
|
} else {
|
||||||
|
inputValue.value = t('chat.uploadFile.fileMessage')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 粘贴处理
|
// 粘贴处理
|
||||||
|
|||||||
@ -67,6 +67,7 @@ export default {
|
|||||||
limitMessage2: 'files',
|
limitMessage2: 'files',
|
||||||
sizeLimit: 'Each file must not exceed',
|
sizeLimit: 'Each file must not exceed',
|
||||||
imageMessage: 'Please process the image content',
|
imageMessage: 'Please process the image content',
|
||||||
|
fileMessage: 'Please process the file content',
|
||||||
errorMessage: 'Upload Failed',
|
errorMessage: 'Upload Failed',
|
||||||
},
|
},
|
||||||
executionDetails: {
|
executionDetails: {
|
||||||
|
|||||||
@ -69,6 +69,7 @@ export default {
|
|||||||
limitMessage2: '个文件',
|
limitMessage2: '个文件',
|
||||||
sizeLimit: '单个文件大小不能超过',
|
sizeLimit: '单个文件大小不能超过',
|
||||||
imageMessage: '请解析图片内容',
|
imageMessage: '请解析图片内容',
|
||||||
|
fileMessage: '请解析文件内容',
|
||||||
errorMessage: '上传失败',
|
errorMessage: '上传失败',
|
||||||
},
|
},
|
||||||
executionDetails: {
|
executionDetails: {
|
||||||
|
|||||||
@ -65,6 +65,7 @@ export default {
|
|||||||
limitMessage2: '個文件',
|
limitMessage2: '個文件',
|
||||||
sizeLimit: '單個文件大小不能超過',
|
sizeLimit: '單個文件大小不能超過',
|
||||||
imageMessage: '請解析圖片內容',
|
imageMessage: '請解析圖片內容',
|
||||||
|
fileMessage: '請解析文件內容',
|
||||||
errorMessage: '上傳失敗',
|
errorMessage: '上傳失敗',
|
||||||
},
|
},
|
||||||
executionDetails: {
|
executionDetails: {
|
||||||
|
|||||||
@ -56,31 +56,33 @@
|
|||||||
{{ paginationConfig.total }}
|
{{ paginationConfig.total }}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<el-button
|
|
||||||
type="primary"
|
<div
|
||||||
:disabled="current?.is_auth"
|
class="flex align-center"
|
||||||
@click="handleSave"
|
|
||||||
v-if="
|
v-if="
|
||||||
route.path.includes('share/')
|
route.path.includes('share/')
|
||||||
? false
|
? false
|
||||||
: hasPermission(
|
: hasPermission(permissionObj[currentPermissionKey], 'OR')
|
||||||
permissionObj[
|
|
||||||
currentPermissionKey
|
|
||||||
],
|
|
||||||
'OR',
|
|
||||||
)
|
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
{{ t('common.save') }}
|
<div class="color-secondary mr-8">{{ $t('views.chatUser.autoAuthorization') }}</div>
|
||||||
</el-button>
|
<el-switch
|
||||||
|
size="small"
|
||||||
|
:model-value="current?.is_auth"
|
||||||
|
@click="changeAuth"
|
||||||
|
:loading="loading"
|
||||||
|
></el-switch>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex-between mb-16" style="margin-top: 18px">
|
<div class="flex-between mb-16" style="margin-top: 18px">
|
||||||
<div class="flex complex-search">
|
<div class="flex complex-search">
|
||||||
<el-select class="complex-search__left" v-model="searchType" style="width: 120px">
|
<el-select class="complex-search__left" v-model="searchType" style="width: 120px">
|
||||||
<el-option :label="$t('views.login.loginForm.username.label')" value="username" />
|
<el-option :label="$t('views.login.loginForm.username.label')" value="username" />
|
||||||
<el-option :label="$t('views.userManage.userForm.nick_name.label')"
|
<el-option
|
||||||
value="nick_name"/>
|
:label="$t('views.userManage.userForm.nick_name.label')"
|
||||||
|
value="nick_name"
|
||||||
|
/>
|
||||||
<el-option :label="$t('views.userManage.source.label')" value="source" />
|
<el-option :label="$t('views.userManage.source.label')" value="source" />
|
||||||
</el-select>
|
</el-select>
|
||||||
<el-input
|
<el-input
|
||||||
@ -107,62 +109,28 @@
|
|||||||
style="width: 220px"
|
style="width: 220px"
|
||||||
clearable
|
clearable
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option :label="$t('views.userManage.source.local')" value="LOCAL" />
|
||||||
:label="$t('views.userManage.source.local')"
|
<el-option label="CAS" value="CAS" />
|
||||||
value="LOCAL"
|
<el-option label="LDAP" value="LDAP" />
|
||||||
/>
|
<el-option label="OIDC" value="OIDC" />
|
||||||
<el-option
|
<el-option label="OAuth2" value="OAuth2" />
|
||||||
label="CAS"
|
<el-option :label="$t('views.userManage.source.wecom')" value="wecom" />
|
||||||
value="CAS"
|
<el-option :label="$t('views.userManage.source.lark')" value="lark" />
|
||||||
/>
|
<el-option :label="$t('views.userManage.source.dingtalk')" value="dingtalk" />
|
||||||
<el-option
|
|
||||||
label="LDAP"
|
|
||||||
value="LDAP"
|
|
||||||
/>
|
|
||||||
<el-option
|
|
||||||
label="OIDC"
|
|
||||||
value="OIDC"
|
|
||||||
/>
|
|
||||||
<el-option
|
|
||||||
label="OAuth2"
|
|
||||||
value="OAuth2"
|
|
||||||
/>
|
|
||||||
<el-option
|
|
||||||
:label="$t('views.userManage.source.wecom')"
|
|
||||||
value="wecom"
|
|
||||||
/>
|
|
||||||
<el-option
|
|
||||||
:label="$t('views.userManage.source.lark')"
|
|
||||||
value="lark"
|
|
||||||
/>
|
|
||||||
<el-option
|
|
||||||
:label="$t('views.userManage.source.dingtalk')"
|
|
||||||
value="dingtalk"
|
|
||||||
/>
|
|
||||||
</el-select>
|
</el-select>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div
|
<el-button
|
||||||
class="flex align-center"
|
type="primary"
|
||||||
|
:disabled="current?.is_auth"
|
||||||
|
@click="handleSave"
|
||||||
v-if="
|
v-if="
|
||||||
route.path.includes('share/')
|
route.path.includes('share/')
|
||||||
? false
|
? false
|
||||||
: hasPermission(
|
: hasPermission(permissionObj[currentPermissionKey], 'OR')
|
||||||
permissionObj[
|
|
||||||
currentPermissionKey
|
|
||||||
],
|
|
||||||
'OR',
|
|
||||||
)
|
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
<div class="color-secondary mr-8">{{ $t('views.chatUser.autoAuthorization') }}</div>
|
{{ t('common.save') }}
|
||||||
<el-switch
|
</el-button>
|
||||||
size="small"
|
|
||||||
:model-value="current?.is_auth"
|
|
||||||
@click="changeAuth"
|
|
||||||
:loading="loading"
|
|
||||||
></el-switch>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<app-table
|
<app-table
|
||||||
@ -202,8 +170,7 @@
|
|||||||
:disabled="current?.is_auth"
|
:disabled="current?.is_auth"
|
||||||
@change="handleCheckAll"
|
@change="handleCheckAll"
|
||||||
>{{ $t('views.chatUser.authorization') }}
|
>{{ $t('views.chatUser.authorization') }}
|
||||||
</el-checkbox
|
</el-checkbox>
|
||||||
>
|
|
||||||
</template>
|
</template>
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-checkbox
|
<el-checkbox
|
||||||
@ -383,22 +350,16 @@ const isShared = computed(() => {
|
|||||||
async function getList() {
|
async function getList() {
|
||||||
if (!current.value?.id) return
|
if (!current.value?.id) return
|
||||||
const params: any = {}
|
const params: any = {}
|
||||||
const searchValue = searchForm.value[searchType.value as keyof typeof searchForm.value];
|
const searchValue = searchForm.value[searchType.value as keyof typeof searchForm.value]
|
||||||
if (searchValue !== undefined && searchValue !== null && searchValue !== '') {
|
if (searchValue !== undefined && searchValue !== null && searchValue !== '') {
|
||||||
params[searchType.value] = searchValue;
|
params[searchType.value] = searchValue
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
const res = await loadSharedApi({
|
const res = await loadSharedApi({
|
||||||
type: 'chatUser',
|
type: 'chatUser',
|
||||||
isShared: isShared.value,
|
isShared: isShared.value,
|
||||||
systemType: apiType.value,
|
systemType: apiType.value,
|
||||||
}).getUserGroupUserList(
|
}).getUserGroupUserList(resource, current.value?.id, paginationConfig, params, rightLoading)
|
||||||
resource,
|
|
||||||
current.value?.id,
|
|
||||||
paginationConfig,
|
|
||||||
params,
|
|
||||||
rightLoading,
|
|
||||||
)
|
|
||||||
// 更新缓存和回显状态
|
// 更新缓存和回显状态
|
||||||
res.data.records.forEach((item: any) => {
|
res.data.records.forEach((item: any) => {
|
||||||
if (checkedMap[item.id] === undefined) {
|
if (checkedMap[item.id] === undefined) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user