mirror of
https://github.com/labring/FastGPT.git
synced 2025-12-26 04:32:50 +00:00
fix: chat window auth
This commit is contained in:
parent
5b9185159d
commit
75073a64fb
|
|
@ -30,7 +30,12 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
|
|||
if (chatId) {
|
||||
// 获取 chat.content 数据
|
||||
history = await Chat.aggregate([
|
||||
{ $match: { _id: new mongoose.Types.ObjectId(chatId) } },
|
||||
{
|
||||
$match: {
|
||||
_id: new mongoose.Types.ObjectId(chatId),
|
||||
userId: new mongoose.Types.ObjectId(userId)
|
||||
}
|
||||
},
|
||||
{ $unwind: '$content' },
|
||||
{ $match: { 'content.deleted': false } },
|
||||
{ $sort: { 'content._id': -1 } },
|
||||
|
|
|
|||
Loading…
Reference in New Issue