1 2 3 4 5 6 7 | public function _initialize(){ //判断session有没有被清除 $login = session( 'bisAccount' , '' , 'bis' ); if (! $login && ! $login [ 'id' ]){ $this ->error( '您已退出,没有权限访问此页面' , 'login/index' ); } } |
老师,我在Base.php中可不可以这样写?
我这样写,页面的功能也是可以实现的,但是我感觉还是老师您写的看上去更严谨一些,
请问如果像我这种写法,在实际生产中会有什么弊端呢?