TaoLer/app/middleware/LogedCheck.php

17 lines
275 B
PHP
Raw Permalink Normal View History

2020-01-01 13:17:19 +08:00
<?php
namespace app\middleware;
use think\facade\Session;
class LogedCheck
{
public function handle($request, \Closure $next)
{
//已登陆跳出
if(Session::has('user_id')){
2020-12-08 14:03:46 +08:00
return redirect((string) url('user/index'));
2020-01-01 13:17:19 +08:00
}
return $next($request);
}
}