doomiwork 4.0.2 → 4.0.3
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/core/controller.js
CHANGED
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@ const moment = require('moment')
|
|
|
9
9
|
* 或者已固定的方式解析关键字
|
|
10
10
|
*/
|
|
11
11
|
module.exports.parseKeyValue=(req,str)=>{
|
|
12
|
-
if (!str) return str;
|
|
12
|
+
if (!str) return str||'';
|
|
13
13
|
const strItems = str.split('.');
|
|
14
14
|
if (strItems.length===1)
|
|
15
15
|
{
|
|
@@ -26,7 +26,7 @@ module.exports.parseKeyValue=(req,str)=>{
|
|
|
26
26
|
return null;
|
|
27
27
|
case "now()": return moment().format('YYYY-MM-DD HH:mm:ss');
|
|
28
28
|
case "null()": return null;
|
|
29
|
-
default: return (req.body && req.body[str])||(req.query && req.query[str]);
|
|
29
|
+
default: return (req.body && req.body[str])||(req.query && req.query[str])||'';
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
else
|
|
@@ -43,7 +43,7 @@ module.exports.parseKeyValue=(req,str)=>{
|
|
|
43
43
|
case "user": collection = req.user || {}; break;
|
|
44
44
|
default: collection = req.body; break;
|
|
45
45
|
}
|
|
46
|
-
if (collection) return collection[strItems[1]];
|
|
46
|
+
if (collection) return collection[strItems[1]] || '';
|
|
47
47
|
return '';
|
|
48
48
|
}
|
|
49
49
|
}
|
|
@@ -63,7 +63,7 @@ module.exports.parseTagInSql = (req, sql, allowNull = true) => {
|
|
|
63
63
|
///是否有格式要求
|
|
64
64
|
let validformat = matchValue.split('|');
|
|
65
65
|
matchValue = validformat[0];
|
|
66
|
-
let keyValue = parseKeyValue(req, matchValue)
|
|
66
|
+
let keyValue = (parseKeyValue(req, matchValue) || '')+''; //utility.ifNull(keyParse.parseKeyValue(req, matchValue), '')+'';
|
|
67
67
|
if (!keyValue) {
|
|
68
68
|
parseKeyWordIsNull = true;
|
|
69
69
|
} else if (typeof (keyValue) === 'string') {
|