小编kev*_*cus的帖子

Laravel 5忽略特定于身份验证的路由

我是laravel 5的新手.我有一个仪表板页面和一个登录页面.无论何时我去localhost:8080/dashboard它总是重定向我localhost:8080/auth/login.

我希望在localhost:8080/dashboard没有先登录的情况下显示我的仪表板.这是我的代码VerifyCsfrToken

namespace App\Http\Middleware;

use Closure;
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as BaseVerifier;

class VerifyCsrfToken extends BaseVerifier {

    /**
     * Handle an incoming request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure  $next
     * @return mixed
     */


    protected $except_urls = [
        'dashboard/dashboard',
    ];

    public function handle($request, Closure $next)
    {
        $regex = '#' . implode('|', $this->except_urls) . '#';

        if ($this->isReading($request) || $this->tokensMatch($request) || preg_match($regex, $request->path()))
        {
            return $this->addCookieToResponse($request, $next($request));
        }

        throw new TokenMismatchException;

        return parent::handle($request, $next); …
Run Code Online (Sandbox Code Playgroud)

php authentication token laravel

4
推荐指数
1
解决办法
6880
查看次数

如何在jquery中插入两者之间的字符?

我从数据库中获取此数据,12345123412但在我的页面中我需要将其显示为12345-1234-12.关于如何处理这个问题的任何想法?我正在努力做到这一点.split()

jquery

0
推荐指数
1
解决办法
28
查看次数

标签 统计

authentication ×1

jquery ×1

laravel ×1

php ×1

token ×1