doomiwork 2.9.5 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/utilities/requestparser.js +11 -2
package/package.json
CHANGED
|
@@ -59,9 +59,18 @@ class RequestParser {
|
|
|
59
59
|
///确认是否是需要导出Excel
|
|
60
60
|
const export2Excel =(req.query.exportexcel+"").toLowerCase()==="true";
|
|
61
61
|
req.page = req.query.page || req.body.page|| 1;
|
|
62
|
-
req.pageSize = req.query.rows || req.body.rows ||
|
|
62
|
+
req.pageSize = req.query.rows || req.body.rows || 100;
|
|
63
63
|
req.sort = req.query.sort || req.body.sort;
|
|
64
|
-
|
|
64
|
+
//防止注入式Sql
|
|
65
|
+
if (isNaN(req.pageSize)){
|
|
66
|
+
req.pageSize = 30;
|
|
67
|
+
}
|
|
68
|
+
//防止注入式Sql
|
|
69
|
+
if (isNaN(req.page)) {
|
|
70
|
+
req.page = 1;
|
|
71
|
+
}
|
|
72
|
+
///最大允许获取100条数据
|
|
73
|
+
req.pageSize = Math.min(req.pageSize,100);
|
|
65
74
|
req.order =req.sort? utility.ifNull((req.body.order == null ? req.query.order : req.body.order), ""):'';
|
|
66
75
|
if (dataKey) {
|
|
67
76
|
req.dataConfig = dataconfig.getConfig(dataKey,cfgType);
|