public function login(Request $request){
$dl = $request ->post();
$validate = Validate::make([
'password' => 'require|min:3|max:20',
]);
$yz = $validate ->check($dl);
if($yz){
$user = Db::table('bf_yh') ->where('username',$dl['username']) -> where('password',md5($dl['password'])) ->find();
if($user){
return $this -> success('登陆成功!!','index/rk/index');
}else{
return $this -> error('用户名或密码错误!');
}
}else{
return $this -> error($validate ->getError());
}
}错误提示致命错误: Call to undefined method app\index\controller\Index::success()
或者是
致命错误: Call to undefined method app\index\controller\Index::error()
最佳答案