b0af62fd by yangjianbin

init

1 parent 49d62003
......@@ -11,3 +11,10 @@ defined('BASEPATH') OR exit('No direct script access allowed');
| https://codeigniter.com/user_guide/general/hooks.html
|
*/
$hook['post_controller_constructor'] = array(
'class' => 'CheckLogin',
'function' => 'check',
'filename' => 'CheckLogin.php',
'filepath' => 'hooks',
'params' => array('beer', 'wine', 'snacks')
);
\ No newline at end of file
......
......@@ -4,6 +4,11 @@ defined('BASEPATH') OR exit('No direct script access allowed');
class Work extends CI_Controller
{
public function __construct(){
parent::__construct();
$this->load->model();
}
/**
* 控制台默认页面
*/
......
<?php
class CheckLogin
{
private $CI;
public function __construct()
{
$this->CI = &get_instance();
}
/** * 权限认证 */
public function check()
{
/*if (preg_match("/admin|base/i", uri_string())) {
if(!$this->CI->session->isadmin){
redirect('login');
return;
}
}
if (preg_match('/ucenter/i', uri_string())) {
if (!$this->CI->session->islogin) {
redirect('login/app');
return;
}
}*/
}
}
\ No newline at end of file
<?php
class Base_model extends CI_Model{
public function __construct(){
parent::__construct();
}
public function xx()
{
return 'xxx';
}
}
\ No newline at end of file
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!