// +---------------------------------------------------------------------- namespace app\bbs\controller; use app\home\controller\Base; class Cbase extends Base{ protected function _initialize(){ parent::_initialize(); $this->check_login(); $yf_home_path=__ROOT__.'/app/bbs/view/szwjs/'; $this->assign('yf_home_path',$yf_home_path); } /** * 检查用户登录 */ public function check_login(){ if(!session('hid')){ $this->error("请先登录(只限会员登录)",url('home/index/index')); } $user=session('user'); if(!in_array($user['member_list_groupid'],[7,10])){ $this->error("只限会员登录"); } $check=input('check'); if($check){ $this->success("登录成功"); } } }