验证码
public function yana() { //var_dump($_POST);die; if (!empty($_POST)) { $captcha = $_POST['yanz']; if (empty($captcha)) { return $this->error('验证码不能为空!'); } $return_result = $this->validate(['captcha' => $captcha], [ 'captcha|验证码' => 'require|captcha' ]); if ($return_result === true) { return json(['msg' => 'b']); } else { return $this->error($return_result); } } }