diff --git a/server/controllers/project.js b/server/controllers/project.js index e2c62288..69ee27c4 100644 --- a/server/controllers/project.js +++ b/server/controllers/project.js @@ -229,7 +229,7 @@ class projectController extends baseController { let result = await this.Model.listWithPaging(group_id, page, limit); let count = await this.Model.listCount(); ctx.body = yapi.commons.resReturn({ - total: count, + total: Math.ceil(count / limit), list: result }) }catch(err){ diff --git a/server/controllers/user.js b/server/controllers/user.js index a98fe230..cbe0fd54 100644 --- a/server/controllers/user.js +++ b/server/controllers/user.js @@ -305,7 +305,7 @@ class userController extends baseController { let user = await userInst.listWithPaging(page, limit); let count = await userInst.listCount(); return ctx.body = yapi.commons.resReturn({ - total: count, + total: Math.ceil(count / limit), list: user }); } catch(e) { diff --git a/server_dist/controllers/project.js b/server_dist/controllers/project.js index 824b8f84..3b9b1414 100644 --- a/server_dist/controllers/project.js +++ b/server_dist/controllers/project.js @@ -608,7 +608,7 @@ var projectController = function (_baseController) { count = _context6.sent; ctx.body = _yapi2.default.commons.resReturn({ - total: count, + total: Math.ceil(count / limit), list: result }); _context6.next = 16; diff --git a/server_dist/controllers/user.js b/server_dist/controllers/user.js index ecab6179..480a26f6 100644 --- a/server_dist/controllers/user.js +++ b/server_dist/controllers/user.js @@ -666,7 +666,7 @@ var userController = function (_baseController) { case 8: count = _context9.sent; return _context9.abrupt('return', ctx.body = _yapi2.default.commons.resReturn({ - total: count, + total: Math.ceil(count / limit), list: user }));