Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
杨建斌
/
page
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
1
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
b0af62fd
authored
2018-03-20 22:27:38 +0800
by
yangjianbin
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
init
1 parent
49d62003
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
56 additions
and
0 deletions
application/config/hooks.php
application/controllers/Work.php
application/hooks/CheckLogin.php
application/models/Base_model.php
application/config/hooks.php
View file @
b0af62f
...
...
@@ -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
...
...
application/controllers/Work.php
View file @
b0af62f
...
...
@@ -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
();
}
/**
* 控制台默认页面
*/
...
...
application/hooks/CheckLogin.php
0 → 100644
View file @
b0af62f
<?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
application/models/Base_model.php
0 → 100644
View file @
b0af62f
<?php
class
Base_model
extends
CI_Model
{
public
function
__construct
(){
parent
::
__construct
();
}
public
function
xx
()
{
return
'xxx'
;
}
}
\ No newline at end of file
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment