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) {
|
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 } },
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user