2018-06-11 11:32:51 1215次浏览 0条回答 0 悬赏 20 金钱

想要实现登陆后才能使用系统,所以在基类中进行了判断,但是页面浏览器一直报页面无限跳转的错误,请各位大神指教

class BaseController extends Controller
{
    public function init()
    {
        if(!isset($_SESSION['username']))
        {
          return $this->redirect(['/site/login']);
        }
        else
        {
            return $this->redirect(['/site/index']);
        }
    }

}

浏览器中的链接:http://localhost:8073/index.php?r=site%2Flogin

    没有找到数据。
您需要登录后才可以回答。登录 | 立即注册
xfcy
见习主管

xfcy

注册时间:2017-09-14
最后登录:2018-11-12
在线时长:10小时5分
  • 粉丝0
  • 金钱215
  • 威望0
  • 积分315

热门问题