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

WBOY
Release: 2016-06-06 20:23:01
Original
1318 people have browsed it

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

回复内容:

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

AuthController.php添加

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

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

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

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!