fix: 修改pageSize和pageIndex的默认值

This commit is contained in:
chaosBreaking
2019-09-07 15:32:56 +08:00
parent cc4e4eb7f7
commit 403da58e78
2 changed files with 2 additions and 2 deletions

View File

@@ -28,7 +28,7 @@ module.exports = {
},
async getActions (req, res) {
const { userId } = res.locals.user;
const { pageIndex = 0, pageSize = 0 } = req.query;
const { pageIndex = 1, pageSize = 0 } = req.query;
return await Action.find({
userId
}, actionFilter).skip((pageIndex - 1) * pageSize).limit(pageSize)