mirror of
https://github.com/thinkjs/thinkjs.git
synced 2026-02-01 15:23:03 +00:00
add _validateInvoked property to check validate method is invoked
This commit is contained in:
parent
960e308980
commit
1c3ae780d4
@ -111,6 +111,7 @@ export default class extends think.controller.base {
|
||||
* @return {} []
|
||||
*/
|
||||
validate(data) {
|
||||
this._validateInvoked = true;
|
||||
if(think.isEmpty(data)){
|
||||
return true;
|
||||
}
|
||||
@ -134,7 +135,7 @@ export default class extends think.controller.base {
|
||||
* @return {} []
|
||||
*/
|
||||
__after(){
|
||||
if(think.isEmpty(this.rules)){
|
||||
if(think.isEmpty(this.rules) || this._validateInvoked){
|
||||
return;
|
||||
}
|
||||
let flag = this.validate(this.rules);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user