* Date: 2018/11/29 0029 21:56 */ namespace app\admin\request; use think\exception\HttpException; use think\Request; abstract class FormRequest extends Request { /** * FormRequest constructor. */ public function __construct() { parent::__construct(); if ($this->withServer($_SERVER)->isAjax(true) && $err = $this->validate()) { throw new HttpException(0, $err); } } }