<?php

namespace App\Http\Middleware;

use Closure;

class CpAuth
{
    /**
     * 判断是否登陆.
     */
    public function handle($request, Closure $next)
    {
        $current_url = url()->current();
        
        if(empty(session('cp_manage_auth'))) {
        	\Log::info('not_has_cp_manage_auth');
        	return redirect()->to('/login');
        }else{
        	\Log::info('has_cp_manage_auth');
        }

        $response = $next($request);
        return $response;
    }
}
