// 下面代码可以用
$this->redirect(url('login/index'));

// 下面为错误的
redirect(url('login/index'));

// 正确使用方法
return redirect(url('login/index'));