切换导航条
此项目
正在载入...
登录
何书鹏
/
recruit
·
提交
转到一个项目
GitLab
转到仪表盘
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
Karson
7 years ago
提交
3a92ef5564dc9702cf50addac966aba0d7b83066
1 个父辈
b7300ea5
修复非超级管理员添加分组的错误
修复登录后默认不是控制台首页的BUG
隐藏空白字符变更
内嵌
并排对比
正在显示
3 个修改的文件
包含
24 行增加
和
18 行删除
application/admin/controller/auth/Admin.php
application/admin/controller/auth/Group.php
public/assets/js/backend/index.js
application/admin/controller/auth/Admin.php
查看文件 @
3a92ef5
...
...
@@ -30,7 +30,6 @@ class Admin extends Backend
$this
->
childrenGroupIds
=
$this
->
auth
->
getChildrenGroupIds
(
$this
->
auth
->
isSuperAdmin
()
?
true
:
false
);
$groupList
=
collection
(
AuthGroup
::
where
(
'id'
,
'in'
,
$this
->
childrenGroupIds
)
->
select
())
->
toArray
();
$groupIds
=
$this
->
auth
->
getGroupIds
();
Tree
::
instance
()
->
init
(
$groupList
);
$result
=
[];
if
(
$this
->
auth
->
isSuperAdmin
())
...
...
@@ -39,9 +38,10 @@ class Admin extends Backend
}
else
{
foreach
(
$groupIds
as
$m
=>
$n
)
$groups
=
$this
->
auth
->
getGroups
();
foreach
(
$groups
as
$m
=>
$n
)
{
$result
=
array_merge
(
$result
,
Tree
::
instance
()
->
getTreeList
(
Tree
::
instance
()
->
getTreeArray
(
$n
)));
$result
=
array_merge
(
$result
,
Tree
::
instance
()
->
getTreeList
(
Tree
::
instance
()
->
getTreeArray
(
$n
[
'pid'
]
)));
}
}
$groupName
=
[];
...
...
@@ -61,7 +61,6 @@ class Admin extends Backend
{
if
(
$this
->
request
->
isAjax
())
{
$childrenGroupIds
=
$this
->
childrenGroupIds
;
$groupName
=
AuthGroup
::
where
(
'id'
,
'in'
,
$childrenGroupIds
)
->
column
(
'id,name'
);
...
...
@@ -75,7 +74,11 @@ class Admin extends Backend
if
(
isset
(
$groupName
[
$v
[
'group_id'
]]))
$adminGroupName
[
$v
[
'uid'
]][
$v
[
'group_id'
]]
=
$groupName
[
$v
[
'group_id'
]];
}
$groups
=
$this
->
auth
->
getGroups
();
foreach
(
$groups
as
$m
=>
$n
)
{
$adminGroupName
[
$this
->
auth
->
id
][
$n
[
'id'
]]
=
$n
[
'name'
];
}
list
(
$where
,
$sort
,
$order
,
$offset
,
$limit
)
=
$this
->
buildparams
();
$total
=
$this
->
model
->
where
(
$where
)
...
...
application/admin/controller/auth/Group.php
查看文件 @
3a92ef5
...
...
@@ -31,7 +31,7 @@ class Group extends Backend
$this
->
childrenGroupIds
=
$this
->
auth
->
getChildrenGroupIds
(
true
);
$groupList
=
collection
(
AuthGroup
::
where
(
'id'
,
'in'
,
$this
->
childrenGroupIds
)
->
select
())
->
toArray
();
$groupIds
=
$this
->
auth
->
getGroupIds
();
Tree
::
instance
()
->
init
(
$groupList
);
$result
=
[];
if
(
$this
->
auth
->
isSuperAdmin
())
...
...
@@ -40,9 +40,10 @@ class Group extends Backend
}
else
{
foreach
(
$groupIds
as
$m
=>
$n
)
$groups
=
$this
->
auth
->
getGroups
();
foreach
(
$groups
as
$m
=>
$n
)
{
$result
=
array_merge
(
$result
,
Tree
::
instance
()
->
getTreeList
(
Tree
::
instance
()
->
getTreeArray
(
$n
)));
$result
=
array_merge
(
$result
,
Tree
::
instance
()
->
getTreeList
(
Tree
::
instance
()
->
getTreeArray
(
$n
[
'pid'
]
)));
}
}
$groupName
=
[];
...
...
public/assets/js/backend/index.js
查看文件 @
3a92ef5
...
...
@@ -180,23 +180,25 @@ define(['jquery', 'bootstrap', 'backend', 'addtabs', 'adminlte', 'form'], functi
//绑定tabs事件,如果需要点击强制刷新iframe,则请将iframeForceRefresh置为true
$
(
'#nav'
).
addtabs
({
iframeHeight
:
"100%"
,
iframeForceRefresh
:
false
});
var
addtabs
=
localStorage
.
getItem
(
"addtabs"
);
if
(
$
(
"ul.sidebar-menu li.active a"
).
size
()
>
0
)
{
$
(
"ul.sidebar-menu li.active a"
).
trigger
(
"click"
);
}
else
{
$
(
"ul.sidebar-menu li a[url!='javascript:;']:first"
).
trigger
(
"click"
);
}
if
(
addtabs
)
{
var
active
=
$
(
"ul.sidebar-menu li a[addtabs="
+
$
(
addtabs
).
attr
(
"addtabs"
)
+
"]"
);
if
(
active
.
size
()
>
0
)
{
active
.
trigger
(
"click"
);
//如果是刷新操作则直接返回刷新前的页面
var
addtabs
=
Config
.
referer
?
localStorage
.
getItem
(
"addtabs"
)
:
null
;
if
(
Config
.
referer
)
{
if
(
Config
.
referer
===
$
(
addtabs
).
attr
(
"url"
))
{
var
active
=
$
(
"ul.sidebar-menu li a[addtabs="
+
$
(
addtabs
).
attr
(
"addtabs"
)
+
"]"
);
if
(
active
.
size
()
>
0
)
{
active
.
trigger
(
"click"
);
}
else
{
$
(
addtabs
).
appendTo
(
document
.
body
).
addClass
(
"hide"
).
trigger
(
"click"
);
}
}
else
{
$
(
addtabs
).
appendTo
(
document
.
body
).
addClass
(
"hide"
).
trigger
(
"click"
);
//刷新页面后跳到到刷新前的页面
Backend
.
api
.
addtabs
(
Config
.
referer
);
}
}
else
if
(
Config
.
referer
)
{
//刷新页面后跳到到刷新前的页面
Backend
.
api
.
addtabs
(
Config
.
referer
);
}
/**
...
...
请
注册
或
登录
后发表评论