fix: avatar error remove (#4173)

* fix: avatar error remove

* fix: index

* fix: guide

* fix: auth
This commit is contained in:
Archer
2025-03-14 20:13:06 +08:00
committed by GitHub
parent 93f7747904
commit f406c64d3c
7 changed files with 24 additions and 9 deletions

View File

@@ -96,7 +96,7 @@ function Code(e: any) {
if (codeType === CodeClassNameEnum.guide) {
return <ChatGuide text={strChildren} />;
}
if (codeType === CodeClassNameEnum.questionGuide) {
if (codeType === CodeClassNameEnum.questionguide) {
return <QuestionGuide text={strChildren} />;
}
if (codeType === CodeClassNameEnum.echarts) {

View File

@@ -1,6 +1,6 @@
export enum CodeClassNameEnum {
guide = 'guide',
questionGuide = 'questionGuide',
questionguide = 'questionguide',
mermaid = 'mermaid',
echarts = 'echarts',
quote = 'quote',

View File

@@ -59,7 +59,7 @@ type Props = BasicProps & {
const RenderQuestionGuide = ({ questionGuides }: { questionGuides: string[] }) => {
return (
<Markdown
source={`\`\`\`${CodeClassNameEnum.questionGuide}
source={`\`\`\`${CodeClassNameEnum.questionguide}
${JSON.stringify(questionGuides)}`}
/>
);

View File

@@ -70,8 +70,9 @@ const CollectionReader = ({
appId: metadata.appId,
...metadata.outLinkAuthData
}),
[metadata]
[chatItemDataId, collectionId, metadata.appId, metadata.chatId, metadata.outLinkAuthData]
);
const {
dataList: datasetDataList,
isLoading,
@@ -108,13 +109,22 @@ const CollectionReader = ({
url: '/api/core/dataset/collection/export',
filename: 'data.csv',
body: {
collectionId: collectionId,
chatItemDataId
appId: metadata.appId,
chatId: metadata.chatId,
chatItemDataId,
collectionId,
...metadata.outLinkAuthData
}
});
});
const handleRead = getCollectionSourceAndOpen(metadata);
const handleRead = getCollectionSourceAndOpen({
appId: metadata.appId,
chatId: metadata.chatId,
chatItemDataId,
collectionId,
...metadata.outLinkAuthData
});
return (
<MyBox display={'flex'} flexDirection={'column'} h={'full'}>

View File

@@ -8,6 +8,7 @@ import { FilterQuery, Types } from 'mongoose';
import { quoteDataFieldSelector, QuoteDataItemType } from '@/service/core/chat/constants';
import { processChatTimeFilter } from '@/service/core/chat/utils';
import { ChatErrEnum } from '@fastgpt/global/common/error/code/chat';
import { getCollectionWithDataset } from '@fastgpt/service/core/dataset/controller';
export type GetCollectionQuoteProps = LinkedPaginationProps & {
chatId: string;
@@ -50,7 +51,8 @@ async function handler(
const limitedPageSize = Math.min(pageSize, 30);
const [{ chat, showRawSource }, { chatItem }] = await Promise.all([
const [collection, { chat, showRawSource }, { chatItem }] = await Promise.all([
getCollectionWithDataset(collectionId),
authChatCrud({
req,
authToken: true,
@@ -69,6 +71,8 @@ async function handler(
if (!chat) return Promise.reject(ChatErrEnum.unAuthChat);
const baseMatch: BaseMatchType = {
teamId: collection.teamId,
datasetId: collection.datasetId,
collectionId,
$or: [
{ updateTime: { $lt: new Date(chatItem.time) } },