diff --git a/docSite/content/zh-cn/docs/development/upgrading/491.md b/docSite/content/zh-cn/docs/development/upgrading/491.md
index 51b20836b..4ca516ca7 100644
--- a/docSite/content/zh-cn/docs/development/upgrading/491.md
+++ b/docSite/content/zh-cn/docs/development/upgrading/491.md
@@ -34,3 +34,4 @@ weight: 799
6. 模型渠道测试时,实际未指定渠道测试。
7. 新增自定义模型时,会把默认模型字段也保存,导致默认模型误判。
8. 修复 promp 模式工具调用,未判空思考链,导致 UI 错误展示。
+9. 编辑应用信息导致头像丢失。
diff --git a/packages/service/common/file/image/controller.ts b/packages/service/common/file/image/controller.ts
index 0bf898337..a90916277 100644
--- a/packages/service/common/file/image/controller.ts
+++ b/packages/service/common/file/image/controller.ts
@@ -76,7 +76,7 @@ export const refreshSourceAvatar = async (
const newId = getIdFromPath(path);
const oldId = getIdFromPath(oldPath);
- if (!newId) return;
+ if (!newId || newId === oldId) return;
await MongoImage.updateOne({ _id: newId }, { $unset: { expiredTime: 1 } }, { session });
diff --git a/projects/app/src/components/Markdown/index.tsx b/projects/app/src/components/Markdown/index.tsx
index 0f04538d7..dea85eb8d 100644
--- a/projects/app/src/components/Markdown/index.tsx
+++ b/projects/app/src/components/Markdown/index.tsx
@@ -96,7 +96,7 @@ function Code(e: any) {
if (codeType === CodeClassNameEnum.guide) {
return ;
}
- if (codeType === CodeClassNameEnum.questionGuide) {
+ if (codeType === CodeClassNameEnum.questionguide) {
return ;
}
if (codeType === CodeClassNameEnum.echarts) {
diff --git a/projects/app/src/components/Markdown/utils.ts b/projects/app/src/components/Markdown/utils.ts
index 869d4fe1f..feb21c149 100644
--- a/projects/app/src/components/Markdown/utils.ts
+++ b/projects/app/src/components/Markdown/utils.ts
@@ -1,6 +1,6 @@
export enum CodeClassNameEnum {
guide = 'guide',
- questionGuide = 'questionGuide',
+ questionguide = 'questionguide',
mermaid = 'mermaid',
echarts = 'echarts',
quote = 'quote',
diff --git a/projects/app/src/components/core/chat/ChatContainer/ChatBox/components/ChatItem.tsx b/projects/app/src/components/core/chat/ChatContainer/ChatBox/components/ChatItem.tsx
index 1540e72b9..cd0392d09 100644
--- a/projects/app/src/components/core/chat/ChatContainer/ChatBox/components/ChatItem.tsx
+++ b/projects/app/src/components/core/chat/ChatContainer/ChatBox/components/ChatItem.tsx
@@ -59,7 +59,7 @@ type Props = BasicProps & {
const RenderQuestionGuide = ({ questionGuides }: { questionGuides: string[] }) => {
return (
);
diff --git a/projects/app/src/pageComponents/chat/ChatQuoteList/CollectionQuoteReader.tsx b/projects/app/src/pageComponents/chat/ChatQuoteList/CollectionQuoteReader.tsx
index 529b6436b..5f23d88b0 100644
--- a/projects/app/src/pageComponents/chat/ChatQuoteList/CollectionQuoteReader.tsx
+++ b/projects/app/src/pageComponents/chat/ChatQuoteList/CollectionQuoteReader.tsx
@@ -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 (
diff --git a/projects/app/src/pages/api/core/chat/quote/getCollectionQuote.ts b/projects/app/src/pages/api/core/chat/quote/getCollectionQuote.ts
index 2afa42849..4652dbcc8 100644
--- a/projects/app/src/pages/api/core/chat/quote/getCollectionQuote.ts
+++ b/projects/app/src/pages/api/core/chat/quote/getCollectionQuote.ts
@@ -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) } },