Home  >  Article  >  Backend Development  >  la5.1 用auth验证,如何跳转到其他路由?

la5.1 用auth验证,如何跳转到其他路由?

WBOY
WBOYOriginal
2016-06-06 20:23:011336browse

如题:验证通过后,想跳转到其他的控制器,所以像文档说的,在authcontroller里加入$redirectPath='/app',不起作用,后加入$redirectTo = ‘/app’仍然没有作用。我该如何是好呢?

回复内容:

如题:验证通过后,想跳转到其他的控制器,所以像文档说的,在authcontroller里加入$redirectPath='/app',不起作用,后加入$redirectTo = ‘/app’仍然没有作用。我该如何是好呢?

AuthController.php添加

<code>protected $redirectAfterLogout = 'auth/login';//退出跳转
protected $redirectTo = 'admin/post';//登录跳转</code>

app/Http/Auth/AuthController.php 中添加如下语句:

protected $redirectPath = '你跳转的地址';

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn