Commit 75073a64 by archer

fix: chat window auth

parent 5b918515
...@@ -30,7 +30,12 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse) ...@@ -30,7 +30,12 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
if (chatId) { if (chatId) {
// 获取 chat.content 数据 // 获取 chat.content 数据
history = await Chat.aggregate([ 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' }, { $unwind: '$content' },
{ $match: { 'content.deleted': false } }, { $match: { 'content.deleted': false } },
{ $sort: { 'content._id': -1 } }, { $sort: { 'content._id': -1 } },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment