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
b81ea1f7
Commit
b81ea1f7
authored
Jan 22, 2018
by
zfc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加权限编辑1
parent
eec36560
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
54 additions
and
108 deletions
+54
-108
.gitignore
.gitignore
+2
-0
Auth.php
application/index/controller/Auth.php
+48
-0
access.html
application/index/view/auth/access.html
+3
-107
route.php
application/route.php
+1
-0
auth.js
public/resource/js/auth.js
+0
-1
No files found.
.gitignore
View file @
b81ea1f7
...
@@ -2,3 +2,4 @@
...
@@ -2,3 +2,4 @@
composer.lock
composer.lock
*.log
*.log
/nbproject/private/
\ No newline at end of file
application/index/controller/Auth.php
View file @
b81ea1f7
...
@@ -119,4 +119,51 @@ class Auth extends Basic
...
@@ -119,4 +119,51 @@ class Auth extends Basic
}
}
}
}
/**
* 权限分配
* @param integer $group_id 组ID
* @return [type] [description]
* @date 2018-01-22
* @author zfc
*/
public
function
access_look
(
$group_id
=
0
){
$table
=
New
AuthGroup
();
$data
[
'title'
]
=
'权限分配'
;
echo
$group_id
;
exit
;
if
(
IS_POST
&&
$group_id
=
0
)
{
//添加or修改
$data
[
'id'
]
=
$group_id
;
$menu_auth
=
input
(
'post.menu_auth/a'
,
''
);
//获取所有授权菜单id
$data
[
'rules'
]
=
implode
(
','
,
$menu_auth
);
//拼接
$id
=
isset
(
$data
[
'id'
])
&&
$data
[
'id'
]
>
0
?
$data
[
'id'
]
:
false
;
//开发过程中先关闭这个限制
//if($group_id==1){
//$this->error('不能修改超级管理员'.$title);
// }else{
if
(
$table
->
editData
(
$data
,
$id
))
{
cache
(
'admin_sidebar_menus_'
.
$this
->
currentUser
[
'uid'
],
null
);
return
$this
->
response
(
200
,
'成功'
);
}
else
{
return
$this
->
response
(
100
,
'失败'
);
}
//}
}
else
{
//查看
$role_auth_rule
=
$table
->
where
([
'id'
=>
intval
(
$group_id
)])
->
value
(
'rules'
);
$data
[
'menu_auth_rules'
]
=
explode
(
','
,
$role_auth_rule
);
//获取指定获取到的权限
}
$menu
=
$table
->
where
([
'pid'
=>
0
,
'status'
=>
1
])
->
order
(
'sort asc'
)
->
select
();
foreach
(
$menu
as
$k
=>
$v
){
$menu
[
$k
][
'_child'
]
=
$this
->
authRuleModel
->
where
([
'pid'
=>
$v
[
'id'
]])
->
order
(
'sort asc'
)
->
select
();
}
$data
[
'all_auth_rules'
]
=
$menu
;
//所以规则
return
$this
->
response
(
200
,
'可以查看'
,
$data
);
}
}
}
\ No newline at end of file
application/index/view/auth/access.html
View file @
b81ea1f7
{layout name="global/frame_tpl" /}
{layout name="global/frame_tpl" /}
<input
type=
"hidden"
class=
"page-load"
id=
"business_district"
/>
<!--关联js文件-->
<div
id=
"page-content-wrapper"
>
<div
id=
"page-content-wrapper"
>
<div
class=
"container"
>
<div
class=
"container"
>
<div
class=
"col-lg-10 col-lg-offset-0"
>
<div
class=
"col-lg-10 col-lg-offset-0"
>
...
@@ -18,113 +19,8 @@
...
@@ -18,113 +19,8 @@
<div
id=
"tab2"
class=
"tab-pane"
>
<div
id=
"tab2"
class=
"tab-pane"
>
<form
action=
""
method=
"post"
class=
"form-builder form-horizontal responsive"
>
<form
action=
""
method=
"post"
class=
"form-builder form-horizontal responsive"
>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<div
class=
"auth"
>
<div
class=
"auth"
id=
"access_box"
>
<div
class=
"admin"
>
<div
class=
"ud-control ud-checkbox"
>
<label
class=
"checkbox-label checkbox-inline"
>
<div
class=
"icheckbox_minimal-blue checked"
aria-checked=
"false"
aria-disabled=
"false"
style=
"position: relative;"
><input
type=
"checkbox"
name=
"menu_auth[]"
data-module-name=
"admin"
checked=
""
value=
"1"
style=
"position: absolute; top: -20%; left: -20%; display: block; width: 140%; height: 140%; margin: 0px; padding: 0px; background: rgb(255, 255, 255); border: 0px; opacity: 0;"
><ins
class=
"iCheck-helper"
style=
"position: absolute; top: -20%; left: -20%; display: block; width: 140%; height: 140%; margin: 0px; padding: 0px; background: rgb(255, 255, 255); border: 0px; opacity: 0;"
></ins></div>
<span
class=
"ud-control-indicator"
></span>
<span>
仪表盘
</span>
</label>
<div
class=
"auth1"
style=
"padding-left: 25px;margin-top: 10px;"
>
</div>
</div>
</div>
<hr>
<div
class=
"admin"
>
<div
class=
"ud-control ud-checkbox"
>
<label
class=
"checkbox-label checkbox-inline"
>
<div
class=
"icheckbox_minimal-blue checked"
aria-checked=
"false"
aria-disabled=
"false"
style=
"position: relative;"
><input
type=
"checkbox"
name=
"menu_auth[]"
data-module-name=
"admin"
checked=
""
value=
"2"
style=
"position: absolute; top: -20%; left: -20%; display: block; width: 140%; height: 140%; margin: 0px; padding: 0px; background: rgb(255, 255, 255); border: 0px; opacity: 0;"
><ins
class=
"iCheck-helper"
style=
"position: absolute; top: -20%; left: -20%; display: block; width: 140%; height: 140%; margin: 0px; padding: 0px; background: rgb(255, 255, 255); border: 0px; opacity: 0;"
></ins></div>
<span
class=
"ud-control-indicator"
></span>
<span>
系统设置
</span>
</label>
<div
class=
"auth2"
style=
"padding-left: 25px;margin-top: 10px;"
>
<label
class=
"checkbox-label checkbox-inline"
>
<div
class=
"icheckbox_minimal-blue"
aria-checked=
"false"
aria-disabled=
"false"
style=
"position: relative;"
><input
type=
"checkbox"
name=
"menu_auth[]"
data-module-name=
"admin"
value=
"12"
style=
"position: absolute; top: -20%; left: -20%; display: block; width: 140%; height: 140%; margin: 0px; padding: 0px; background: rgb(255, 255, 255); border: 0px; opacity: 0;"
><ins
class=
"iCheck-helper"
style=
"position: absolute; top: -20%; left: -20%; display: block; width: 140%; height: 140%; margin: 0px; padding: 0px; background: rgb(255, 255, 255); border: 0px; opacity: 0;"
></ins></div>
<span
class=
"ud-control-indicator"
></span>
<span>
设置
</span>
</label>
<div
class=
"auth12"
style=
"padding-left: 25px;margin-top: 10px;"
>
</div>
<label
class=
"checkbox-label checkbox-inline"
>
<div
class=
"icheckbox_minimal-blue checked"
aria-checked=
"false"
aria-disabled=
"false"
style=
"position: relative;"
><input
type=
"checkbox"
name=
"menu_auth[]"
data-module-name=
"admin"
checked=
""
value=
"26"
style=
"position: absolute; top: -20%; left: -20%; display: block; width: 140%; height: 140%; margin: 0px; padding: 0px; background: rgb(255, 255, 255); border: 0px; opacity: 0;"
><ins
class=
"iCheck-helper"
style=
"position: absolute; top: -20%; left: -20%; display: block; width: 140%; height: 140%; margin: 0px; padding: 0px; background: rgb(255, 255, 255); border: 0px; opacity: 0;"
></ins></div>
<span
class=
"ud-control-indicator"
></span>
<span>
系统设置
</span>
</label>
<div
class=
"auth26"
style=
"padding-left: 25px;margin-top: 10px;"
>
</div>
<label
class=
"checkbox-label checkbox-inline"
>
<div
class=
"icheckbox_minimal-blue"
aria-checked=
"false"
aria-disabled=
"false"
style=
"position: relative;"
><input
type=
"checkbox"
name=
"menu_auth[]"
data-module-name=
"admin"
value=
"19"
style=
"position: absolute; top: -20%; left: -20%; display: block; width: 140%; height: 140%; margin: 0px; padding: 0px; background: rgb(255, 255, 255); border: 0px; opacity: 0;"
><ins
class=
"iCheck-helper"
style=
"position: absolute; top: -20%; left: -20%; display: block; width: 140%; height: 140%; margin: 0px; padding: 0px; background: rgb(255, 255, 255); border: 0px; opacity: 0;"
></ins></div>
<span
class=
"ud-control-indicator"
></span>
<span>
网站设置
</span>
</label>
<div
class=
"auth19"
style=
"padding-left: 25px;margin-top: 10px;"
>
</div>
<label
class=
"checkbox-label checkbox-inline"
>
<div
class=
"icheckbox_minimal-blue checked"
aria-checked=
"false"
aria-disabled=
"false"
style=
"position: relative;"
><input
type=
"checkbox"
name=
"menu_auth[]"
data-module-name=
"admin"
checked=
""
value=
"9"
style=
"position: absolute; top: -20%; left: -20%; display: block; width: 140%; height: 140%; margin: 0px; padding: 0px; background: rgb(255, 255, 255); border: 0px; opacity: 0;"
><ins
class=
"iCheck-helper"
style=
"position: absolute; top: -20%; left: -20%; display: block; width: 140%; height: 140%; margin: 0px; padding: 0px; background: rgb(255, 255, 255); border: 0px; opacity: 0;"
></ins></div>
<span
class=
"ud-control-indicator"
></span>
<span>
后台菜单管理
</span>
</label>
<div
class=
"auth9"
style=
"padding-left: 25px;margin-top: 10px;"
>
</div>
<label
class=
"checkbox-label checkbox-inline"
>
<div
class=
"icheckbox_minimal-blue"
aria-checked=
"false"
aria-disabled=
"false"
style=
"position: relative;"
><input
type=
"checkbox"
name=
"menu_auth[]"
data-module-name=
"admin"
value=
"25"
style=
"position: absolute; top: -20%; left: -20%; display: block; width: 140%; height: 140%; margin: 0px; padding: 0px; background: rgb(255, 255, 255); border: 0px; opacity: 0;"
><ins
class=
"iCheck-helper"
style=
"position: absolute; top: -20%; left: -20%; display: block; width: 140%; height: 140%; margin: 0px; padding: 0px; background: rgb(255, 255, 255); border: 0px; opacity: 0;"
></ins></div>
<span
class=
"ud-control-indicator"
></span>
<span>
配置管理
</span>
</label>
<div
class=
"auth25"
style=
"padding-left: 25px;margin-top: 10px;"
>
</div>
</div>
</div>
</div>
<hr>
<div
class=
"admin"
>
<div
class=
"ud-control ud-checkbox"
>
<label
class=
"checkbox-label checkbox-inline"
>
<div
class=
"icheckbox_minimal-blue checked"
aria-checked=
"false"
aria-disabled=
"false"
style=
"position: relative;"
><input
type=
"checkbox"
name=
"menu_auth[]"
data-module-name=
"admin"
checked=
""
value=
"5"
style=
"position: absolute; top: -20%; left: -20%; display: block; width: 140%; height: 140%; margin: 0px; padding: 0px; background: rgb(255, 255, 255); border: 0px; opacity: 0;"
><ins
class=
"iCheck-helper"
style=
"position: absolute; top: -20%; left: -20%; display: block; width: 140%; height: 140%; margin: 0px; padding: 0px; background: rgb(255, 255, 255); border: 0px; opacity: 0;"
></ins></div>
<span
class=
"ud-control-indicator"
></span>
<span>
扩展中心
</span>
</label>
<div
class=
"auth5"
style=
"padding-left: 25px;margin-top: 10px;"
>
<label
class=
"checkbox-label checkbox-inline"
>
<div
class=
"icheckbox_minimal-blue checked"
aria-checked=
"false"
aria-disabled=
"false"
style=
"position: relative;"
><input
type=
"checkbox"
name=
"menu_auth[]"
data-module-name=
"admin"
checked=
""
value=
"24"
style=
"position: absolute; top: -20%; left: -20%; display: block; width: 140%; height: 140%; margin: 0px; padding: 0px; background: rgb(255, 255, 255); border: 0px; opacity: 0;"
><ins
class=
"iCheck-helper"
style=
"position: absolute; top: -20%; left: -20%; display: block; width: 140%; height: 140%; margin: 0px; padding: 0px; background: rgb(255, 255, 255); border: 0px; opacity: 0;"
></ins></div>
<span
class=
"ud-control-indicator"
></span>
<span>
模块
</span>
</label>
<div
class=
"auth24"
style=
"padding-left: 25px;margin-top: 10px;"
>
</div>
<label
class=
"checkbox-label checkbox-inline"
>
<div
class=
"icheckbox_minimal-blue"
aria-checked=
"false"
aria-disabled=
"false"
style=
"position: relative;"
><input
type=
"checkbox"
name=
"menu_auth[]"
data-module-name=
"admin"
value=
"45"
style=
"position: absolute; top: -20%; left: -20%; display: block; width: 140%; height: 140%; margin: 0px; padding: 0px; background: rgb(255, 255, 255); border: 0px; opacity: 0;"
><ins
class=
"iCheck-helper"
style=
"position: absolute; top: -20%; left: -20%; display: block; width: 140%; height: 140%; margin: 0px; padding: 0px; background: rgb(255, 255, 255); border: 0px; opacity: 0;"
></ins></div>
<span
class=
"ud-control-indicator"
></span>
<span>
444
</span>
</label>
<div
class=
"auth45"
style=
"padding-left: 25px;margin-top: 10px;"
>
</div>
<label
class=
"checkbox-label checkbox-inline"
>
<div
class=
"icheckbox_minimal-blue"
aria-checked=
"false"
aria-disabled=
"false"
style=
"position: relative;"
><input
type=
"checkbox"
name=
"menu_auth[]"
data-module-name=
"admin"
value=
"46"
style=
"position: absolute; top: -20%; left: -20%; display: block; width: 140%; height: 140%; margin: 0px; padding: 0px; background: rgb(255, 255, 255); border: 0px; opacity: 0;"
><ins
class=
"iCheck-helper"
style=
"position: absolute; top: -20%; left: -20%; display: block; width: 140%; height: 140%; margin: 0px; padding: 0px; background: rgb(255, 255, 255); border: 0px; opacity: 0;"
></ins></div>
<span
class=
"ud-control-indicator"
></span>
<span>
88888888888
</span>
</label>
<div
class=
"auth46"
style=
"padding-left: 25px;margin-top: 10px;"
>
</div>
<label
class=
"checkbox-label checkbox-inline"
>
<div
class=
"icheckbox_minimal-blue"
aria-checked=
"false"
aria-disabled=
"false"
style=
"position: relative;"
><input
type=
"checkbox"
name=
"menu_auth[]"
data-module-name=
"admin"
value=
"23"
style=
"position: absolute; top: -20%; left: -20%; display: block; width: 140%; height: 140%; margin: 0px; padding: 0px; background: rgb(255, 255, 255); border: 0px; opacity: 0;"
><ins
class=
"iCheck-helper"
style=
"position: absolute; top: -20%; left: -20%; display: block; width: 140%; height: 140%; margin: 0px; padding: 0px; background: rgb(255, 255, 255); border: 0px; opacity: 0;"
></ins></div>
<span
class=
"ud-control-indicator"
></span>
<span>
插件
</span>
</label>
<div
class=
"auth23"
style=
"padding-left: 25px;margin-top: 10px;"
>
</div>
<label
class=
"checkbox-label checkbox-inline"
>
<div
class=
"icheckbox_minimal-blue checked"
aria-checked=
"false"
aria-disabled=
"false"
style=
"position: relative;"
><input
type=
"checkbox"
name=
"menu_auth[]"
data-module-name=
"admin"
checked=
""
value=
"22"
style=
"position: absolute; top: -20%; left: -20%; display: block; width: 140%; height: 140%; margin: 0px; padding: 0px; background: rgb(255, 255, 255); border: 0px; opacity: 0;"
><ins
class=
"iCheck-helper"
style=
"position: absolute; top: -20%; left: -20%; display: block; width: 140%; height: 140%; margin: 0px; padding: 0px; background: rgb(255, 255, 255); border: 0px; opacity: 0;"
></ins></div>
<span
class=
"ud-control-indicator"
></span>
<span>
主题
</span>
</label>
<div
class=
"auth22"
style=
"padding-left: 25px;margin-top: 10px;"
>
</div>
</div>
</div>
</div>
<hr>
</div>
</div>
</div>
</div>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
...
...
application/route.php
View file @
b81ea1f7
...
@@ -76,6 +76,7 @@ Route::group('index', [
...
@@ -76,6 +76,7 @@ Route::group('index', [
'getAuth'
=>
[
'index/auth/getAuth'
,
[
'method'
=>
'get'
]],
//权限列表
'getAuth'
=>
[
'index/auth/getAuth'
,
[
'method'
=>
'get'
]],
//权限列表
'access'
=>
[
'index/auth/access'
,
[
'method'
=>
'get'
]],
//权限分配
'access'
=>
[
'index/auth/access'
,
[
'method'
=>
'get'
]],
//权限分配
'addAuth'
=>
[
'index/auth/addAuth'
,
[
'method'
=>
'post'
]],
//添加角色
'addAuth'
=>
[
'index/auth/addAuth'
,
[
'method'
=>
'post'
]],
//添加角色
'access_look'
=>
[
'index/auth/access_look'
,
[
'method'
=>
'post'
]],
//查看编辑角色权限
'roleedit'
=>
[
'index/auth/roleedit'
,
[
'method'
=>
'get'
]],
//编辑角色
'roleedit'
=>
[
'index/auth/roleedit'
,
[
'method'
=>
'get'
]],
//编辑角色
'accessUser'
=>
[
'index/auth/accessUser'
,
[
'method'
=>
'get'
]],
//成员授权
'accessUser'
=>
[
'index/auth/accessUser'
,
[
'method'
=>
'get'
]],
//成员授权
'BusinessDistrict'
=>
[
'index/BusinessDistrict/index'
,
[
'method'
=>
'get'
]],
//商圈列表
'BusinessDistrict'
=>
[
'index/BusinessDistrict/index'
,
[
'method'
=>
'get'
]],
//商圈列表
...
...
public/resource/js/auth.js
View file @
b81ea1f7
...
@@ -27,7 +27,6 @@ define (['doT', 'text!temp/auth_template_tpl.html', 'css!style/home.css','pagina
...
@@ -27,7 +27,6 @@ define (['doT', 'text!temp/auth_template_tpl.html', 'css!style/home.css','pagina
var
temp
=
document
.
getElementById
(
'auth_list_tpl'
).
innerHTML
;
var
temp
=
document
.
getElementById
(
'auth_list_tpl'
).
innerHTML
;
var
doTtmpl
=
doT
.
template
(
temp
);
var
doTtmpl
=
doT
.
template
(
temp
);
$
(
"#auth_list"
).
html
(
doTtmpl
(
data
.
data
.
list
));
$
(
"#auth_list"
).
html
(
doTtmpl
(
data
.
data
.
list
));
/*分页代码*/
/*分页代码*/
$
(
"#pagediv"
).
pagination
({
$
(
"#pagediv"
).
pagination
({
length
:
data
.
data
.
total
,
length
:
data
.
data
.
total
,
...
...
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