Skip to content

Commit

Permalink
修正Dispatch
Browse files Browse the repository at this point in the history
  • Loading branch information
liu21st committed May 19, 2018
1 parent 1205fe6 commit 6448c4b
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions library/think/route/Dispatch.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public function run()

// 数据自动验证
if (isset($option['validate'])) {
$this->autoValidate($option['validate'], $request);
$this->autoValidate($option['validate']);
}

return $this->exec();
Expand Down Expand Up @@ -197,11 +197,10 @@ protected function checkAfter($after)
* 验证数据
* @access protected
* @param array $option
* @param \think\Request $request
* @return void
* @throws ValidateException
*/
protected function autoValidate($option, $request)
protected function autoValidate($option)
{
list($validate, $scene, $message, $batch) = $option;

Expand All @@ -226,7 +225,7 @@ protected function autoValidate($option, $request)
$v->batch(true);
}

if (!$v->check($request->param())) {
if (!$v->check($this->request->param())) {
throw new ValidateException($v->getError());
}
}
Expand Down

0 comments on commit 6448c4b

Please sign in to comment.