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…
x
Reference in New Issue
Block a user