doomiwork 3.7.7 → 3.7.9

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "doomiwork",
3
- "version": "3.7.7",
3
+ "version": "3.7.9",
4
4
  "description": "doomisoft nodejs web framework",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -50,7 +50,13 @@ class ViewHelper {
50
50
  if (element.action && element.action.indexOf(doWhat) < 0) continue;
51
51
  let bodyKey = element.mapping || element.name;
52
52
  let postValue = req.body[bodyKey];
53
-
53
+ ////body中没有这个属性
54
+ //&& element.ignoreundefined == true
55
+ if (postValue === undefined ){
56
+ if ((doWhat == 'update' && !element.required && !element.default && !element.nullValue) ||
57
+ (doWhat == 'create' && !element.required && !element.default && !element.nullValue))
58
+ continue;
59
+ }
54
60
  ///去除两边的空格,默认是去掉空格
55
61
  if (typeof (postValue) === 'string'){
56
62
  if ((element.trim == null || element.trim == true)) postValue.trim();