fix(admin): add wxOpenid to fuzzy search, enhance admin tab info
- Backend getUsers: add wxOpenid to regex search - Backend getAdmins: return gravity, plan, wxOpenid, email fields - Frontend admin tab: show full user info (ID copy, email, gravity, plan) - Frontend search result: show complete user details like user list rows
This commit is contained in:
@@ -86,6 +86,7 @@ export class AdminController {
|
||||
{ phone: { $regex: escaped, $options: 'i' } },
|
||||
{ nickname: { $regex: escaped, $options: 'i' } },
|
||||
{ email: { $regex: escaped, $options: 'i' } },
|
||||
{ wxOpenid: { $regex: escaped, $options: 'i' } },
|
||||
]
|
||||
// 支持按 MongoDB _id 搜索(24位 hex)
|
||||
if (/^[0-9a-f]{24}$/i.test(keyword)) {
|
||||
@@ -250,7 +251,7 @@ export class AdminController {
|
||||
|
||||
@Get('admins')
|
||||
async getAdmins() {
|
||||
const admins = await this.userModel.find({ role: 'admin' }).select('phone nickname email createdAt isSystemAdmin').lean().exec()
|
||||
const admins = await this.userModel.find({ role: 'admin' }).select('phone nickname email wxOpenid gravity plan role createdAt isSystemAdmin').lean().exec()
|
||||
return { admins }
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user