Skip to content

Commit

Permalink
Ignore empty value for parameters, fix #414
Browse files Browse the repository at this point in the history
  • Loading branch information
welefen committed Aug 3, 2016
1 parent 8d7e89d commit 298d44e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/logic/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,10 @@ export default class extends think.controller.base {
let values = think.validate.values(rules);
for(let name in values){
let method = methods[name];
this[method](name, values[name]);
let value = values[name];
if(value !== '' || (typeof value === 'number' && !isNaN(value))){
this[method](name, value);
}
}

return true;
Expand Down

0 comments on commit 298d44e

Please sign in to comment.