public function checkLogin(Request $request)
{
//初始化返回参数
$status = 0;
$result = '';
$data = $request -> param();
//创建验证规则
$rule = [
'name|用户名' => 'require', //用户名必填
'password|密码' => 'require',
'verify|验证码' => 'require|captcha',
];
//自定义验证失败提示信息
$msg = [
'name' => ['require' => '56'],
'password' => ['require' => '22'],
'verify' => ['require' => '33'],
];
//进行验证
$result = $this->validate($data,$rule,$msg);
return ['status'=> $status,'message'=>$result,'data'=>$data];
}