Heim  >  Artikel  >  Backend-Entwicklung  >  la5.1 用auth验证,如何跳转到其他路由?

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

WBOY
WBOYOriginal
2016-06-06 20:23:011309Durchsuche

如题:验证通过后,想跳转到其他的控制器,所以像文档说的,在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 = '你跳转的地址';

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn