Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tl_estate
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hujun
tl_estate
Commits
c22a206e
Commit
c22a206e
authored
Apr 18, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
管理员登录修改
parent
13df2d28
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
6 deletions
+17
-6
Login.php
application/index/controller/Login.php
+9
-1
AuthRule.php
application/model/AuthRule.php
+8
-5
No files found.
application/index/controller/Login.php
View file @
c22a206e
...
@@ -74,8 +74,16 @@ class Login extends Basic
...
@@ -74,8 +74,16 @@ class Login extends Basic
if
(
$list
[
'admin_off'
]
!=
'0'
||
empty
(
$list
[
'rules'
])
||
$list
[
'status'
]
!=
'0'
)
{
if
(
$list
[
'admin_off'
]
!=
'0'
||
empty
(
$list
[
'rules'
])
||
$list
[
'status'
]
!=
'0'
)
{
return
$this
->
response
(
'103'
,
'无后台访问权限'
);
return
$this
->
response
(
'103'
,
'无后台访问权限'
);
}
else
{
}
else
{
$where_rule
[
'status'
]
=
0
;
if
(
$list
[
'id'
]
==
1
)
{
//超级管理员
$nav
=
$this
->
authRule
->
getRule
(
''
,
$where_rule
);
}
else
{
$where_rule
[
'id'
]
=
[
'in'
,
$list
[
'rules'
]];
//查询后台菜单
//查询后台菜单
$nav
=
$this
->
authRule
->
getRule
(
$list
[
'rules'
]);
$nav
=
$this
->
authRule
->
getRule
(
''
,
$list
[
'rules'
]);
}
$menu_data
=
[];
$menu_data
=
[];
$auth_data
=
[];
$auth_data
=
[];
foreach
(
$nav
as
$k
=>
$v
)
{
foreach
(
$nav
as
$k
=>
$v
)
{
...
...
application/model/AuthRule.php
View file @
c22a206e
...
@@ -166,16 +166,18 @@ class AuthRule extends BaseModel
...
@@ -166,16 +166,18 @@ class AuthRule extends BaseModel
}
}
/**
/**
* @param $id
* 规则查询
*
* @param string $field
* @param $where
* @return false|\PDOStatement|string|\think\Collection
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
* @throws \think\exception\DbException
*/
*/
public
function
getRule
(
$id
)
{
public
function
getRule
(
$field
=
'id,name,title,pid,is_menu'
,
$where
)
{
return
$this
->
field
(
'id,name,title,pid,is_menu'
)
return
$this
->
field
(
$field
)
->
where
(
'status'
,
0
)
->
where
(
$where
)
->
where
(
'id'
,
'in'
,
$id
)
->
select
();
->
select
();
}
}
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment