(req, res, next)
| 234 | return md5.update(password).digest('base64'); |
| 235 | } |
| 236 | async getUserList(req, res, next){ |
| 237 | const {limit = 20, offset = 0} = req.query; |
| 238 | try{ |
| 239 | const users = await UserInfoModel.find({}, '-_id').sort({user_id: -1}).limit(Number(limit)).skip(Number(offset)); |
| 240 | res.send(users); |
| 241 | }catch(err){ |
| 242 | console.log('获取用户列表数据失败', err); |
| 243 | res.send({ |
| 244 | status: 0, |
| 245 | type: 'GET_DATA_ERROR', |
| 246 | message: '获取用户列表数据失败' |
| 247 | }) |
| 248 | } |
| 249 | } |
| 250 | async getUserCount(req, res, next){ |
| 251 | try{ |
| 252 | const count = await UserInfoModel.count(); |
nothing calls this directly
no outgoing calls
no test coverage detected