Skip to content

Commit

Permalink
refactor(admin): only show chat image feature will exclude group avat…
Browse files Browse the repository at this point in the history
…ar and background
  • Loading branch information
moonrailgun committed Oct 5, 2024
1 parent 9998c57 commit 4a4adb1
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
1 change: 1 addition & 0 deletions server/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ SMTP_URI=
TAILCHAT_MEETING_URL=

# Admin 后台密码
ADMIN_USER=tailchat
ADMIN_PASS=com.msgbyte.tailchat

# GETUI Push
Expand Down
18 changes: 17 additions & 1 deletion server/admin/src/server/router/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ router.post('/login', (req, res) => {
}
);

res.json({
res.status(200).json({
username,
token: token,
expiredAt: new Date().valueOf() + 2 * 60 * 60 * 1000,
Expand Down Expand Up @@ -312,11 +312,27 @@ router.use(
foreignField: 'avatar',
as: 'avatarMatchedUser',
})
.lookup({
from: 'groups',
localField: 'url',
foreignField: 'avatar',
as: 'avatarMatchedGroup',
})
.lookup({
from: 'groups',
localField: 'url',
foreignField: 'config.groupBackgroundImage',
as: 'backgroundMatchedGroup',
})
.match({
'avatarMatchedUser.0': { $exists: false },
'avatarMatchedGroup.0': { $exists: false },
'backgroundMatchedGroup.0': { $exists: false },
})
.project({
avatarMatchedUser: 0,
avatarMatchedGroup: 0,
backgroundMatchedGroup: 0,
})
.facet({
metadata: [{ $count: 'total' }],
Expand Down

0 comments on commit 4a4adb1

Please sign in to comment.