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
e315cda8
Commit
e315cda8
authored
Jan 25, 2018
by
zfc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
编辑5
parent
b0b04bce
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
207 additions
and
81 deletions
+207
-81
Auth.php
application/index/controller/Auth.php
+42
-20
access.html
application/index/view/auth/access.html
+1
-1
auth_rule_box.html
application/index/view/auth/auth_rule_box.html
+10
-47
auth_rule_index.html
application/index/view/auth/auth_rule_index.html
+3
-3
AuthGroup.php
application/model/AuthGroup.php
+15
-0
AuthRule.php
application/model/AuthRule.php
+18
-1
BaseModel.php
application/model/BaseModel.php
+7
-0
route.php
application/route.php
+1
-0
access.js
public/resource/js/access.js
+32
-0
auth_rule_box.js
public/resource/js/auth_rule_box.js
+45
-0
public.js
public/resource/js/public.js
+6
-0
role_edit.js
public/resource/js/role_edit.js
+2
-6
access_template_tpl.html
public/resource/template/access_template_tpl.html
+20
-0
auth_rule_box_template_tpl.html
public/resource/template/auth_rule_box_template_tpl.html
+2
-2
auth_rule_index_template_tpl.html
public/resource/template/auth_rule_index_template_tpl.html
+1
-1
Model.php
thinkphp/library/think/Model.php
+2
-0
No files found.
application/index/controller/Auth.php
View file @
e315cda8
...
...
@@ -144,31 +144,27 @@ class Auth extends Basic
/**
*
权限分配
*
角色权限分配or查看
* @param integer $group_id 组ID
* @return [type] [description]
* @date 2018-01-22
* @author zfc
*/
public
function
accessLook
(
$group_id
=
0
){
$table
=
New
AuthGroup
()
;
$table2
=
New
AuthRule
()
;
$table
=
New
AuthGroup
;
$table2
=
New
AuthRule
;
$data
[
'title'
]
=
'权限分配'
;
// echo $group_id;
// exit;
if
(
IS_POST
&&
$group_id
=
0
)
{
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
,
'失败'
);
...
...
@@ -179,13 +175,18 @@ class Auth extends Basic
}
else
{
//查看
$role_auth_rule
=
$table
->
where
([
'id'
=>
intval
(
$group_id
)])
->
value
(
'rules'
);
$data
[
'menu_auth_rules'
]
=
explode
(
','
,
$role_auth_rule
);
//获取指定获取到的权限
$data
[
'rules'
]
=
explode
(
','
,
$role_auth_rule
);
//获取指定获取到的权限
$data
[
'class'
]
=
$this
->
AuthClass
(
1
);
foreach
(
$data
[
'class'
]
as
$v
){
if
(
in_array
(
$v
[
'id'
],
$data
[
'rules'
])){
$v
[
'is'
]
=
'1'
;
}
else
{
$v
[
'is'
]
=
'0'
;
}
}
$menu
=
$table2
->
where
([
'pid'
=>
0
,
'status'
=>
1
])
->
order
(
'sort asc'
)
->
select
();
foreach
(
$menu
as
$k
=>
$v
){
$menu
[
$k
][
'_child'
]
=
$table2
->
where
([
'pid'
=>
$v
[
'id'
]])
->
order
(
'sort asc'
)
->
select
();
}
$data
[
'all_auth_rules'
]
=
$menu
;
//所以规则
return
$this
->
response
(
200
,
'可以查看'
,
$data
);
}
...
...
@@ -241,7 +242,7 @@ class Auth extends Basic
return
view
(
'auth_rule_box'
);
}
//分类列表
public
function
AuthClass
(){
public
function
AuthClass
(
$fu
=
'0'
){
$table
=
new
AuthRule
;
$data
[
'status'
]
=
200
;
$data
[
'msg'
]
=
''
;
...
...
@@ -251,31 +252,52 @@ class Auth extends Basic
$data
[
'list'
]
=
$table
->
authRuleList2
(
$order
,
$field
,
''
,
$where
);
//echo $table->getLastSql();
//prt(collection($data['list'])->toArray());//转化arr
if
(
$fu
==
'1'
){
return
$data
[
'list'
];
}
else
{
return
$this
->
response
(
200
,
'成功'
,
$data
);
}
}
//新增编辑权限
public
function
updateAuthRule
(
$group_id
=
0
){
$data
[
'status'
]
=
200
;
$data
[
'msg'
]
=
''
;
$title
=
$group_id
?
'编辑'
:
'新增'
;
$table
=
New
AuthGroup
();
$table
=
New
AuthRule
;
if
(
IS_POST
)
{
if
(
IS_POST
&&
$group_id
==
0
)
{
$data
=
input
(
'post.'
);
$id
=
isset
(
$data
[
'id'
])
&&
$data
[
'id'
]
>
0
?
$data
[
'id'
]
:
false
;
//判断name是否重复
if
(
$table
->
repetition
(
'name'
,
$data
[
'name'
])
&&
empty
(
$id
)){
return
$this
->
response
(
100
,
'存在重复值'
);
}
//新增或者编辑数据
//prt($data);
if
(
$table
->
editData
(
$data
,
$id
))
{
return
$this
->
response
(
200
,
'成功'
);
}
else
{
return
$this
->
response
(
10
1
,
'失败
'
);
return
$this
->
response
(
10
0
,
'无修改
'
);
}
}
else
{
$info
=
$table
->
findById
(
$group_id
);
return
$this
->
response
(
200
,
$title
,
$info
);
$where
=
"a.id=
{
$group_id
}
"
;
$field
=
"a.*,ifnull(b.title,'顶级菜单') as title2"
;
$order
=
''
;
$join
=
[[
'auth_rule b'
,
' a.pid=b.id'
,
'left'
]];
$info
=
$table
->
authRuleList2
(
$order
,
$field
,
$join
,
$where
);
//echo $table->getLastSql();
return
$this
->
response
(
200
,
$title
,
$info
[
0
]);
}
...
...
application/index/view/auth/access.html
View file @
e315cda8
{layout name="global/frame_tpl" /}
<input
type=
"hidden"
class=
"page-load"
id=
"
business_district
"
/>
<!--关联js文件-->
<input
type=
"hidden"
class=
"page-load"
id=
"
access
"
/>
<!--关联js文件-->
<div
id=
"page-content-wrapper"
>
<div
class=
"container"
>
<div
class=
"col-lg-10 col-lg-offset-0"
>
...
...
application/index/view/auth/auth_rule_box.html
View file @
e315cda8
...
...
@@ -11,35 +11,26 @@
<div
class=
"row"
>
<div
style=
"padding: 20px;margin-left:30px;border-radius:3px;"
class=
"col-md-11"
>
<form
class=
"form-builder form-horizontal"
method=
"post"
action=
"
http://me.tp.com/admin.php/admin/auth/ruleedit/id/1.html?_pjax=%23pjax-container
"
>
<form
class=
"form-builder form-horizontal"
method=
"post"
action=
"
/index/updateAuthRule
"
>
<fieldset>
<div
style=
"display:none;"
class=
"form-group item_id "
>
<label
class=
"col-md-2 control-label"
for=
"id"
>
ID
</label>
<div
class=
"col-md-4"
>
<input
type=
"hidden"
value=
"
1
"
name=
"id"
id=
"id"
class=
"form-control"
>
<input
type=
"hidden"
value=
""
name=
"id"
id=
"id"
class=
"form-control"
>
</div>
<div
class=
"col-md-5 help-block"
><i
class=
"fa fa-info-circle color-info1"
></i>
ID
</div></div>
<div
class=
"form-group item_title "
>
<label
class=
"col-md-2 control-label"
for=
"title"
>
标题
</label>
<label
class=
"col-md-2 control-label"
>
标题
</label>
<div
class=
"col-md-4"
>
<input
type=
"text"
value=
""
name=
"title"
class=
"form-control"
>
</div>
<div
class=
"col-md-5 help-block"
><i
class=
"fa fa-info-circle color-info1"
></i>
用于后台显示的配置标题
</div></div>
<div
class=
"form-group item_depend_flag "
>
<!--<label class="col-md-2 control-label" for="depend_flag">所属模块</label>-->
<!--<div class="col-md-4">-->
<!--<select class="form-control" id="depend_flag" name="depend_flag">-->
<!--<option value="">请选择</option> <option selected="" value="admin">后台模块</option>-->
<!--<option value="home">前台模块</option>-->
<!--<option value="user">用户中心</option>-->
<!--</select>-->
<!--</div>-->
<!--<div class="col-md-6 help-block"><i class="fa fa-info-circle color-info1"></i> 所属的模块,模块菜单必须选择,否则无法导出</div></div>-->
<div
class=
"form-group item_pid "
>
<label
class=
"col-md-2 control-label"
>
上级菜单
</label>
<div
class=
"col-md-4"
>
...
...
@@ -50,28 +41,8 @@
</div>
</div>
<!--<div class="form-group item_icon ">-->
<!--<label class="col-md-2 control-label" for="icon">字体图标</label>-->
<!--<div class="col-md-6">-->
<!--<div id="icon-picker" class="input-group input">-->
<!--<span class="input-group-btn">-->
<!--<button onclick="filter_icon(this);" type="button" class="btn btn-raised btn-default btn-sm"><i class="fa fa-info-circle"></i> 选择图标</button>-->
<!--</span>-->
<!--<input type="text" value="fa-tachometer" id="icon" name="icon" class="form-control iconpicker">-->
<!--</div>-->
<!--</div>-->
<!--</div>-->
<script
type=
"text/javascript"
>
// function setIconFilter(filter) {
// $('#icon').val(filter);
// layer.closeAll('iframe');
// }
</script>
<div
class=
"form-group item_name "
>
<label
class=
"col-md-2 control-label"
for=
"name"
>
链接
</label>
<label
class=
"col-md-2 control-label"
>
链接
</label>
<div
class=
"col-md-4"
>
<input
type=
"text"
value=
""
name=
"name"
class=
"form-control"
>
</div>
...
...
@@ -84,20 +55,20 @@
$option = array('title' => 标题, 'data-id' => 1);
-->
<div
class=
"form-group item_is_menu "
>
<label
class=
"col-md-2 control-label"
for=
"is_menu"
>
后台菜单
</label>
<label
class=
"col-md-2 control-label"
>
后台菜单
</label>
<div
class=
"col-md-8"
>
<div
class=
"oh mb-10 pl-5"
>
<div
class=
"radio radio-primary fl mr-10"
>
<label
class=
"radio-label1"
for=
"is_menu1"
>
<div
class=
"iradio_minimal-blue checked"
style=
"position: relative;"
aria-checked=
"false"
aria-disabled=
"false"
>
<input
type=
"radio"
checked=
""
value=
"1"
id=
"is_menu1"
name=
"is_menu"
style=
""
>
<input
type=
"radio"
value=
"1"
id=
"is_menu1"
name=
"is_menu"
style=
""
>
</div>
是
</label>
</div>
<div
class=
"radio radio-primary fl mr-10"
>
<label
class=
"radio-label2"
for=
"is_menu0"
>
<label
class=
"radio-label2"
>
<div
class=
"iradio_minimal-blue"
style=
"position: relative;"
aria-checked=
"false"
aria-disabled=
"false"
>
<input
type=
"radio"
checked=
""
value=
"1"
id=
"is_menu1
"
name=
"is_menu"
style=
""
>
<input
type=
"radio"
value=
"0"
id=
"is_menu2
"
name=
"is_menu"
style=
""
>
</div>
否
</label>
</div>
...
...
@@ -108,16 +79,8 @@
</div>
<!--
如果选项的值是自定义数组(必须定义key为title的元素)需要解析,如果选项的值是常规字符串直接显示
此处主要是用来给option定义更多的属性,比如data-ia=1,那么option应为
$option = array('title' => 标题, 'data-id' => 1);
-->
<div
class=
"form-group item_sort "
>
<label
class=
"col-md-2 control-label"
for=
"sort"
>
排序
</label>
<label
class=
"col-md-2 control-label"
>
排序
</label>
<div
class=
"col-md-4"
>
<input
type=
"number"
value=
"1"
name=
"sort"
class=
"form-control"
>
</div>
...
...
@@ -126,7 +89,7 @@
<div
class=
"form-group"
>
<div
class=
"col-md-10 col-xs-offset-2 mt-10 tc"
>
<div
class=
"col-md-3 col-xs-6"
>
<
button
target-form=
"form-builder"
type=
"submit"
class=
"btn btn-block btn-primary submit ajax-post "
>
确定
</button
>
<
a
target-form=
"form-builder"
id=
"submit"
class=
"btn btn-block btn-primary submit ajax-post "
>
确定
</a
>
</div>
<div
class=
"col-md-3 col-xs-6"
>
<button
class=
"btn btn-block btn-default return"
onclick=
"javascript:history.back(-1);return false;"
>
返回
</button>
...
...
application/index/view/auth/auth_rule_index.html
View file @
e315cda8
...
...
@@ -35,9 +35,9 @@
<!-- 工具栏按钮 -->
<!--<div class="form-group">-->
<a
href=
"/index/authRuleBox.html"
class=
"btn btn-primary btn-sm"
title=
"新增"
>
新增
</a>
<
a
href=
"/setstatus/status/resume/model/auth_rule.html"
model=
"auth_rule"
class=
"btn btn-success ajax-post confirm btn-sm"
target-form=
"ids"
title=
"启用"
>
启用
</a>
<
a
href=
"/setstatus/status/forbid/model/auth_rule.html"
model=
"auth_rule"
class=
"btn btn-warning ajax-post confirm btn-sm"
target-form=
"ids"
title=
"禁用"
>
禁用
</a>
<
a
href=
"/status/delete/model/auth_rule.html"
model=
"auth_rule"
class=
"btn btn-danger ajax-post confirm btn-sm"
target-form=
"ids"
title=
"删除"
>
删除
</a>
<
!--<a href="/setstatus/status/resume/model/auth_rule.html" model="auth_rule" class="btn btn-success ajax-post confirm btn-sm" target-form="ids" title="启用">启用</a> -->
<
!--<a href="/setstatus/status/forbid/model/auth_rule.html" model="auth_rule" class="btn btn-warning ajax-post confirm btn-sm" target-form="ids" title="禁用">禁用</a> -->
<
!--<a href="/status/delete/model/auth_rule.html" model="auth_rule" class="btn btn-danger ajax-post confirm btn-sm" target-form="ids" title="删除">删除</a> -->
<!--<a onclick="move_menuparent()" title="<i class="fa fa-exchange"></i> 移动位置" class="btn btn-info btn-sm" target-form="ids"><i class="fa fa-exchange"></i> 移动位置</a> -->
<!--<a model="auth_rule" href="/admin.php/admin/auth/rule_sort/pid/0.html" class="btn btn-info btn-sm" name="排序" title="<i class="fa fa-sort"></i> 排序"><i class="fa fa-sort"></i> 排序</a> -->
<!--<!– </div>–>-->
...
...
application/model/AuthGroup.php
View file @
e315cda8
...
...
@@ -186,4 +186,19 @@ class AuthGroup extends BaseModel
->
page
(
$pageNo
)
->
select
();
}
/**
*检查重复
*
*/
public
function
repetition
(
$key
,
$name
){
$r
=
$this
->
field
(
$name
)
->
where
(
$key
,
$name
)
->
select
();
if
(
$r
){
return
true
;
}
else
{
return
false
;
}
}
}
application/model/AuthRule.php
View file @
e315cda8
...
...
@@ -5,7 +5,7 @@ namespace app\model;
use
think\Model
;
class
AuthRule
extends
Model
class
AuthRule
extends
Base
Model
{
// 设置完整的数据表(包含前缀)
// protected $table = 'think_access';
...
...
@@ -61,4 +61,20 @@ class AuthRule extends Model
->
select
();
return
$data
;
}
/**
*检查重复
*
*/
public
function
repetition
(
$name
,
$key
){
$r
=
$this
->
field
(
$name
)
->
where
(
$name
,
'='
,
$key
)
->
select
();
//$this->getLastSql();
if
(
$r
){
return
true
;
}
else
{
return
false
;
}
}
}
\ No newline at end of file
application/model/BaseModel.php
View file @
e315cda8
...
...
@@ -36,14 +36,21 @@ class BaseModel extends Model
$this
->
allowField
(
true
);
if
(
$confirm
)
{
//是否验证
$this
->
validate
(
$confirm
);
}
if
(
$kv
){
//编辑
$res
=
$this
->
save
(
$data
,[
$key
=>
$kv
]);
}
else
{
$res
=
$this
->
data
(
$data
)
->
save
();
}
return
$res
;
}
...
...
application/route.php
View file @
e315cda8
...
...
@@ -85,6 +85,7 @@ Route::group('index', [
'authRuleIndex'
=>
[
'index/auth/authRuleIndex'
,
[
'method'
=>
'get'
]],
//权限列表界面
'authRuleList'
=>
[
'index/auth/authRuleList'
,
[
'method'
=>
'get'
]],
//--规则列表
'authRuleBox'
=>
[
'index/auth/authRuleBox'
,
[
'method'
=>
'get'
]],
//--编辑规则
'updateAuthRule'
=>
[
'index/auth/updateAuthRule'
,
[
'method'
=>
'post'
]],
//--编辑规则接口
'authClass'
=>
[
'index/auth/authClass'
,
[
'method'
=>
'get'
]],
//--规则分类列表
'accessUser'
=>
[
'index/auth/accessUser'
,
[
'method'
=>
'get'
]],
//成员授权
'BusinessDistrict'
=>
[
'index/BusinessDistrict/index'
,
[
'method'
=>
'get'
]],
//商圈列表
...
...
public/resource/js/access.js
0 → 100644
View file @
e315cda8
/* auth 2018/01/23 by dafei
*/
define
([
'doT'
,
'text!temp/access_template_tpl.html'
,
'css!style/home.css'
,
'pagination'
,
'bootstrapJs'
],
function
(
doT
,
template
)
{
var
Role
=
{
init
:
function
()
{
//初始化dot
$
(
"body"
).
append
(
template
);
Role
.
getList
();
Role
.
event
();
},
event
:
function
()
{
},
getList
:
function
(){
//ajax
var
id
=
getUrlParam
(
'id'
);
$
.
ajax
({
url
:
'/index/accessLook/group_id/'
+
id
,
type
:
'post'
,
async
:
true
,
dataType
:
'json'
,
success
:
function
(
data
)
{
var
temp
=
document
.
getElementById
(
'access_tpl'
).
innerHTML
;
var
doTempl
=
doT
.
template
(
temp
);
$
(
"#access_box"
).
html
(
doTempl
(
data
.
data
.
class
));
}
})
}
}
return
Role
;
});
public/resource/js/auth_rule_box.js
View file @
e315cda8
...
...
@@ -8,6 +8,30 @@ define (['doT', 'text!temp/auth_rule_box_template_tpl.html', 'css!style/home.css
},
event
:
function
()
{
$
(
"#submit"
).
click
(
function
()
{
var
par
=
{}
par
.
id
=
$
(
"input[name = id]"
).
val
();
par
.
title
=
$
(
"input[name = title]"
).
val
();
par
.
name
=
$
(
"input[name = name]"
).
val
();
par
.
sort
=
$
(
"input[name = sort]"
).
val
();
par
.
pid
=
$
(
"#pid"
).
val
();
par
.
is_menu
=
$
(
"input[name =is_menu]:checked"
).
val
();
$
.
ajax
({
url
:
'/index/updateAuthRule'
,
data
:
par
,
type
:
'post'
,
async
:
true
,
dataType
:
'json'
,
success
:
function
(
data
)
{
alert
(
data
.
msg
);
console
.
log
(
data
);
}
});
})
},
getList
:
function
(){
$
.
ajax
({
...
...
@@ -20,7 +44,28 @@ define (['doT', 'text!temp/auth_rule_box_template_tpl.html', 'css!style/home.css
var
doTempl
=
doT
.
template
(
temp
);
$
(
"#pid"
).
html
(
doTempl
(
data
.
data
.
list
));
//赋值
}
});
var
id
=
getUrlParam
(
'id'
);
$
.
ajax
({
url
:
'/index/updateAuthRule/group_id/'
+
id
,
type
:
'post'
,
async
:
true
,
dataType
:
'json'
,
success
:
function
(
data
)
{
$
(
"input[name = id]"
).
val
(
data
.
data
.
id
);
$
(
"input[name = title]"
).
val
(
data
.
data
.
title
);
$
(
"input[name = name]"
).
val
(
data
.
data
.
name
);
$
(
"input[name = sort]"
).
val
(
data
.
data
.
sort
);
$
(
"#pid"
).
val
(
data
.
data
.
pid
);
if
(
data
.
data
.
is_menu
==
0
){
$
(
"#is_menu2"
).
attr
(
'checked'
,
true
);
}
else
{
$
(
"#is_menu1"
).
attr
(
'checked'
,
true
);
}
}
})
}
}
...
...
public/resource/js/public.js
View file @
e315cda8
...
...
@@ -26,6 +26,12 @@ define(['doT', 'jquery'], function (doT, $) {
}
});
function
getUrlParam
(
name
)
{
var
reg
=
new
RegExp
(
"(^|&)"
+
name
+
"=([^&]*)(&|$)"
);
var
r
=
decodeURI
(
window
.
location
.
search
).
substr
(
1
).
match
(
reg
);
if
(
r
!=
null
)
return
unescape
(
r
[
2
]);
return
null
;
}
public/resource/js/role_edit.js
View file @
e315cda8
/* auth 2018/01/23 by dafei
*/
define
([
'doT'
,
'
text!temp/user_template_tpl.html'
,
'
css!style/home.css'
,
'pagination'
,
'bootstrapJs'
],
function
(
doT
,
template
)
{
define
([
'doT'
,
'css!style/home.css'
,
'pagination'
,
'bootstrapJs'
],
function
(
doT
,
template
)
{
var
Role
=
{
init
:
function
()
{
//初始化dot
$
(
"body"
).
append
(
template
);
Role
.
getList
();
Role
.
event
();
},
event
:
function
()
{
$
(
"#sss"
).
click
(
function
(){
...
...
@@ -32,11 +33,6 @@ define (['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css','pagina
return
Role
;
});
function
getUrlParam
(
name
)
{
var
reg
=
new
RegExp
(
"(^|&)"
+
name
+
"=([^&]*)(&|$)"
);
var
r
=
decodeURI
(
window
.
location
.
search
).
substr
(
1
).
match
(
reg
);
if
(
r
!=
null
)
return
unescape
(
r
[
2
]);
return
null
;
}
public/resource/template/access_template_tpl.html
0 → 100644
View file @
e315cda8
<script
id=
"access_tpl"
type=
"text/template"
>
[
%
if
(
it
)
{
%
]
[
%
for
(
var
item
in
it
){
%
]
[
%
if
(
it
[
item
][
'pid'
]
!=
0
){
%
]
--
[
%
}
%
]
[
%
if
(
it
[
item
][
'is'
]
!=
0
){
%
]
<
input
type
=
"checkbox"
name
=
"rules[]"
checked
=
"checked"
>
[
%=
it
[
item
][
"title"
]
%
]
<
br
>
[
%
}
else
{
%
]
<
input
type
=
"checkbox"
name
=
"rules[]"
>
[
%=
it
[
item
][
"title"
]
%
]
<
br
>
[
%
}
%
]
[
%
}
%
]
[
%
}
%
]
</script>
\ No newline at end of file
public/resource/template/auth_rule_box_template_tpl.html
View file @
e315cda8
...
...
@@ -4,9 +4,9 @@
[
%
for
(
var
item
in
it
){
%
]
[
%
if
(
it
[
item
][
'pid'
]
!=
0
){
%
]
<
option
value
=
"
45
"
>&
nbsp
;
&
nbsp
;
└
[
%=
it
[
item
][
"title"
]
%
]
&
nbsp
;
<
/option
>
<
option
value
=
"
[%= it[item]['id'] %]
"
>&
nbsp
;
&
nbsp
;
└
[
%=
it
[
item
][
"title"
]
%
]
&
nbsp
;
<
/option
>
[
%
}
else
{
%
]
<
option
value
=
"
1
"
>
[
%=
it
[
item
][
"title"
]
%
]
&
nbsp
;
<
/option
>
<
option
value
=
"
[%= it[item]['id'] %]
"
>
[
%=
it
[
item
][
"title"
]
%
]
&
nbsp
;
<
/option
>
[
%
}
%
]
[
%
}
%
]
...
...
public/resource/template/auth_rule_index_template_tpl.html
View file @
e315cda8
...
...
@@ -15,7 +15,7 @@
<
td
>
[
%=
it
[
item
][
"status"
]
%
]
<
/td
>
<!--<
td
><
span
class
=
"fa fa-check text-success"
><
/span></
td
>-->
<
td
>
<
a
style
=
"margin-right:6px;"
href
=
"/index/authRuleBox
/group_id/
[%= it[item]['id'] %]"
class
=
"btn btn-primary btn-xs"
title
=
"编辑"
>
编辑
<
/a
>
<
a
style
=
"margin-right:6px;"
href
=
"/index/authRuleBox
.html?id=
[%= it[item]['id'] %]"
class
=
"btn btn-primary btn-xs"
title
=
"编辑"
>
编辑
<
/a
>
<
a
style
=
"margin-right:6px;"
href
=
""
class
=
"btn btn-warning btn-xs ajax-get confirm"
title
=
"禁用"
>
禁用
<
/a
>
<
/td
>
<
/tr
>
...
...
thinkphp/library/think/Model.php
View file @
e315cda8
...
...
@@ -298,6 +298,8 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
*/
public
function
data
(
$data
,
$value
=
null
)
{
if
(
is_string
(
$data
))
{
$this
->
data
[
$data
]
=
$value
;
}
else
{
...
...
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