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
d671b463
authored
2018-04-10 21:47:56 +0800
by
Zelig
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
登陆权限bug
1 parent
d8b678f2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
8 deletions
application/helpers/activate_helper.php
application/helpers/activate_helper.php
View file @
d671b46
...
...
@@ -24,15 +24,12 @@ if(!function_exists('hasRole')) {
function
hasRole
(
$roles
=
[])
{
$CI
=
&
get_instance
();
$CI
->
load
->
helper
(
'cookie'
);
$login_user
=
get_cookie
(
'login_user'
);
if
(
$login_user
)
{
$login_user
=
json_decode
(
$login_user
,
true
);
foreach
(
$login_user
[
'roleKeys'
]
as
$v
){
if
(
in_array
(
$v
,
$roles
)){
return
true
;
}
$login_user
=
api
(
'system/user/loginUser'
);
foreach
(
$login_user
->
roleKeys
as
$v
){
if
(
in_array
(
$v
,
$roles
)){
return
true
;
}
return
false
;
}
return
false
;
}
}
...
...
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