时间: 2020-11-25|29次围观|0 条评论

<?php
namespace app\index\controller;
use think\Controller;
use think\Session;

class CommenController extends Controller {
    public function _initialize() {
        if (!Session::has('data')) {
            $this->redirect('/');
        }
    }
}

 除login控制器外其他继承CommenController

//系统退出
    public function logout() {
        //  清除think作用域
        Session::clear('think');
        $this->redirect('/');

    }

  

转载于:https://www.cnblogs.com/yixing/p/9046147.html

原文链接:https://blog.csdn.net/weixin_30342827/article/details/95757056

本站声明:网站内容来源于网络,如有侵权,请联系我们,我们将及时处理。

本博客所有文章如无特别注明均为原创。
复制或转载请以超链接形式注明转自起风了,原文地址《TP5.0防跳墙访问
   

还没有人抢沙发呢~