php在没有登录的情况下自动跳转到登录页
<?php namespace Home\Controller; use Think\Controller; class BaseController extends Controller{ //基础信息,判断登陆 public function __construct(){ parent::__construct(); /*if(!session('?user')){ redirect(U('Home/Login/index')); }*/ } }
<?php namespace Home\Controller; use Think\Controller; class BaseController extends Controller{ //基础信息,判断登陆 public function __construct(){ parent::__construct(); /*if(!session('?user')){ redirect(U('Home/Login/index')); }*/ } }