input('mobile'); if (empty($mobile)) { return $this->failure('请输入手机号'); } //验证码 $code = $request->input('code'); if (empty($code)) { return $this->failure('请输入验证码'); } //检查验证码 $count = config('app.env') == 'production'?Message::where('phone', $mobile)->where('code', $code)->first():1; if (empty($count)) { return $this->failure('验证码错误'); } //密码 $password = $request->input('password'); if (empty($password)) { return $this->failure('请输入密码'); } return $next($request); } catch (\Exception $e) { return $this->failure('参数错误'); } } }