b0af62fd by yangjianbin

init

1 parent 49d62003
...@@ -11,3 +11,10 @@ defined('BASEPATH') OR exit('No direct script access allowed'); ...@@ -11,3 +11,10 @@ defined('BASEPATH') OR exit('No direct script access allowed');
11 | https://codeigniter.com/user_guide/general/hooks.html 11 | https://codeigniter.com/user_guide/general/hooks.html
12 | 12 |
13 */ 13 */
14 $hook['post_controller_constructor'] = array(
15 'class' => 'CheckLogin',
16 'function' => 'check',
17 'filename' => 'CheckLogin.php',
18 'filepath' => 'hooks',
19 'params' => array('beer', 'wine', 'snacks')
20 );
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -4,6 +4,11 @@ defined('BASEPATH') OR exit('No direct script access allowed'); ...@@ -4,6 +4,11 @@ defined('BASEPATH') OR exit('No direct script access allowed');
4 class Work extends CI_Controller 4 class Work extends CI_Controller
5 { 5 {
6 6
7 public function __construct(){
8 parent::__construct();
9 $this->load->model();
10 }
11
7 /** 12 /**
8 * 控制台默认页面 13 * 控制台默认页面
9 */ 14 */
......
1 <?php
2
3 class CheckLogin
4 {
5 private $CI;
6
7 public function __construct()
8 {
9 $this->CI = &get_instance();
10 }
11
12 /** * 权限认证 */
13 public function check()
14 {
15
16 /*if (preg_match("/admin|base/i", uri_string())) {
17 if(!$this->CI->session->isadmin){
18 redirect('login');
19 return;
20 }
21 }
22 if (preg_match('/ucenter/i', uri_string())) {
23 if (!$this->CI->session->islogin) {
24 redirect('login/app');
25 return;
26 }
27 }*/
28 }
29 }
...\ No newline at end of file ...\ No newline at end of file
1 <?php
2
3 class Base_model extends CI_Model{
4
5 public function __construct(){
6 parent::__construct();
7 }
8
9 public function xx()
10 {
11 return 'xxx';
12 }
13
14
15 }
...\ No newline at end of file ...\ 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!