egg-born-module-a-base-sync
Advanced tools
Comparing version 1.2.4 to 1.2.5
@@ -56,2 +56,5 @@ // eslint-disable-next-line | ||
// pageSize | ||
config.pageSize = 20; | ||
// locales | ||
@@ -58,0 +61,0 @@ config.locales = { |
@@ -5,9 +5,11 @@ const require3 = require('require3'); | ||
module.exports = ctx => { | ||
const moduleInfo = ctx.app.meta.mockUtil.parseInfoFromPackage(__dirname); | ||
class Util { | ||
page(_page, force = true) { | ||
const pageSize = ctx.config.module(moduleInfo.relativeName).pageSize; | ||
if (!_page) { | ||
_page = force ? { index: 0 } : { index: 0, size: 0 }; | ||
} | ||
if (_page.size === undefined || (force && (_page.size === 0 || _page.size === -1 || _page.size > ctx.app.config.pageSize))) _page.size = ctx.app.config.pageSize; | ||
if (_page.size === undefined || (force && (_page.size === 0 || _page.size === -1 || _page.size > pageSize))) _page.size = pageSize; | ||
return _page; | ||
@@ -14,0 +16,0 @@ } |
{ | ||
"name": "egg-born-module-a-base-sync", | ||
"version": "1.2.4", | ||
"version": "1.2.5", | ||
"title": "Base", | ||
@@ -5,0 +5,0 @@ "eggBornModule": { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
973346
14306