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
059a9d3c
Commit
059a9d3c
authored
Jan 16, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
edit
parent
ca35c836
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
228 additions
and
11 deletions
+228
-11
database.php
application/database.php
+8
-8
Auth.php
application/index/controller/Auth.php
+27
-0
access.html
application/index/view/auth/access.html
+48
-0
accessUser.html
application/index/view/auth/accessUser.html
+84
-0
roleedit.html
application/index/view/auth/roleedit.html
+55
-0
route.php
application/route.php
+3
-0
auth_template_tpl.html
public/resource/template/auth_template_tpl.html
+3
-3
No files found.
application/database.php
View file @
059a9d3c
...
@@ -13,19 +13,19 @@ return [
...
@@ -13,19 +13,19 @@ return [
// 数据库类型
// 数据库类型
'type'
=>
'mysql'
,
'type'
=>
'mysql'
,
// 服务器地址
// 服务器地址
//
'hostname' => '101.132.186.250',
'hostname'
=>
'101.132.186.250'
,
'hostname'
=>
'127.0.0.1'
,
//
'hostname' => '127.0.0.1',
// 数据库名
// 数据库名
'database'
=>
'db_tongliandichan'
,
'database'
=>
'db_tongliandichan'
,
// 用户名
// 用户名
//
'username' => 'tldc_online',
'username'
=>
'tldc_online'
,
'username'
=>
'root'
,
//
'username' => 'root',
// 密码
// 密码
//
'password' => 'Fujuhaofang123',
'password'
=>
'Fujuhaofang123'
,
'password'
=>
'123456'
,
//
'password' => '123456',
// 端口
// 端口
//
'hostport' => '3308',
'hostport'
=>
'3308'
,
'hostport'
=>
''
,
//
'hostport' => '',
// 连接dsn
// 连接dsn
'dsn'
=>
''
,
'dsn'
=>
''
,
// 数据库连接参数
// 数据库连接参数
...
...
application/index/controller/Auth.php
View file @
059a9d3c
...
@@ -22,6 +22,31 @@ class Auth extends Basic
...
@@ -22,6 +22,31 @@ class Auth extends Basic
return
view
(
'index'
);
return
view
(
'index'
);
}
}
/**
* 角色编辑
*/
public
function
roleedit
()
{
return
view
(
'roleedit'
);
}
/**
* 权限分配
*
* @param type $group_id
*/
public
function
access
(
$group_id
=
0
)
{
return
view
(
'access'
);
}
/**
* 用户组授权用户列表
*
* @param type $group_id
*/
public
function
accessUser
(
$group_id
=
0
)
{
return
view
(
'accessUser'
);
}
public
function
getAuth
()
{
public
function
getAuth
()
{
$data
[
'status'
]
=
200
;
$data
[
'status'
]
=
200
;
$data
[
'msg'
]
=
''
;
$data
[
'msg'
]
=
''
;
...
@@ -33,4 +58,5 @@ class Auth extends Basic
...
@@ -33,4 +58,5 @@ class Auth extends Basic
$data
=
$auth_group
->
getList
(
$pageNo
,
$pageSize
,
''
,
'*'
);
$data
=
$auth_group
->
getList
(
$pageNo
,
$pageSize
,
''
,
'*'
);
return
$this
->
response
(
200
,
''
,
$data
);
return
$this
->
response
(
200
,
''
,
$data
);
}
}
}
}
\ No newline at end of file
application/index/view/auth/access.html
0 → 100644
View file @
059a9d3c
{layout name="global/frame_tpl" /}
<div
id=
"page-content-wrapper"
>
<div
class=
"container"
>
<div
class=
"col-lg-10 col-lg-offset-0"
>
<div
class=
"builder-tabs builder-form-tabs"
>
<ul
class=
"nav nav-tabs"
>
<li
class=
"active"
><a
href=
"/admin.php/admin/auth/role_edit/group_id/3.html"
>
角色信息
</a></li>
<li
class=
""
><a
href=
"/admin.php/admin/auth/access/group_id/3.html"
>
权限分配
</a></li>
<li
class=
""
><a
href=
"/admin.php/admin/auth/accessuser/group_id/3.html"
>
成员授权
</a></li>
</ul>
<div
class=
"form-group"
></div>
</div>
<div
class=
"builder formbuilder-box panel-body bg-color-fff"
>
<div
class=
"row"
>
<div
class=
"col-md-7"
>
<form
action=
""
method=
"post"
class=
"form-builder form-horizontal"
>
<fieldset>
<input
type=
"hidden"
name=
"id"
value=
"3"
>
<div
class=
"form-group"
>
<label
for=
"title"
class=
"col-md-2 control-label"
>
名称:
</label>
<div
class=
"col-md-10"
>
<input
type=
"text"
class=
"form-control"
name=
"title"
placeholder=
"创建的角色名称"
value=
"普通用户"
>
<span
class=
"material-input"
></span>
</div>
</div>
<div
class=
"form-group item_description"
>
<label
for=
"description"
class=
"col-md-2 control-label"
>
描述:
</label>
<div
class=
"col-md-10"
>
<textarea
name=
"description"
class=
"form-control"
length=
"120"
rows=
"5"
>
这是普通用户的权限
</textarea>
<span
class=
"material-input"
></span>
</div>
</div>
<div
class=
"form-group"
>
<div
class=
"col-md-12 col-md-offset-2"
>
<div
class=
"col-md-3"
><button
class=
"btn btn-block btn-primary submit ajax-post"
type=
"submit"
target-form=
"form-builder"
>
确定
</button></div>
<div
class=
"col-md-3"
><button
class=
"btn btn-block btn-default return"
onclick=
"javascript:history.back(-1);return false;"
>
返回
</button></div>
</div>
</div>
</fieldset>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
\ No newline at end of file
application/index/view/auth/accessUser.html
0 → 100644
View file @
059a9d3c
{extend name="public/base"/}
{block name="style"}{/block}
{block name="main"}
<div
class=
"builder-tabs builder-form-tabs"
>
<ul
class=
"nav nav-tabs"
>
<li
class=
""
><a
href=
"{:url('roleedit',array('group_id'=>$group_id))}"
>
角色信息
</a></li>
<li
class=
""
><a
href=
"{:url('access',array('group_id'=>$group_id))}"
>
权限分配
</a></li>
<li
class=
"active"
><a
href=
"{:url('accessUser',['group_id'=>$group_id])}"
>
成员授权
</a></li>
<li
class=
"right form-group mt0 mr20"
>
<select
name=
"group"
class=
"form-control col-md-8"
>
{volist name="auth_group" id="vo"}
<option
value=
"{:url('AuthManager/user',['group_id'=>$vo['id'],'group_name'=>$vo['title']])}"
{
eq
name=
"vo['id']"
value=
"$this_group['id']"
}
selected
{/
eq
}
>
{$vo.title}
</option>
{/volist}
</select>
</li>
</ul>
<div
class=
"form-group"
></div>
</div>
<div
class=
"builder-container listbuilder-box"
>
<div
class=
"row"
>
<div
class=
"builder-table"
>
<!-- 数据列表 -->
<div
class=
"col-sm-12"
>
<table
class=
"table table-responsive table-hover dataTable"
>
<thead>
<tr>
<th
class=
""
>
UID
</th>
<th
class=
""
>
昵称
</th>
<th
class=
""
>
最后登录时间
</th>
<th
class=
""
>
最后登录IP
</th>
<th
class=
""
>
状态
</th>
<th
class=
""
>
操作
</th>
</tr>
</thead>
<tbody>
{volist name="_list" id="vo"}
<tr>
<td>
{$vo.uid}
</td>
<td>
{$vo.nickname}
</td>
<td><span>
{$vo.last_login_time|time_format}
</span></td>
<td><span>
{$vo.last_login_ip}
</span></td>
<td>
{switch name="vo.status"}
{case value="-1"}删除{/case}
{case value="0"}禁用{/case}
{case value="1"}正常{/case}
{case value="2"}待审核{/case}
{case value="3"}草稿{/case}
{default /}未知
{/switch}
</td>
<td><a
href=
"{:url('auth/removeFromGroup?uid='.$vo['uid'].'&group_id='.input('group_id'))}"
class=
"ajax-get"
>
解除授权
</a>
</td>
</tr>
{/volist}
</tbody>
</table>
</div>
</div>
<div
class=
"main-title"
>
<div
class=
"page_nav col-md-8"
>
{$_list->render()}
</div>
<div
id=
"add-to-group"
class=
"tools col-md-4"
>
<form
class=
"add-user"
action=
"{:url('addToGroup')}"
method=
"post"
enctype=
"application/x-www-form-urlencoded"
>
<div
class=
"form-group"
>
<div
class=
"col-md-10"
>
<input
class=
"form-control"
type=
"text"
name=
"uid"
placeholder=
"请输入uid,多个用英文逗号分隔"
>
</div>
<input
type=
"hidden"
name=
"group_id"
value=
"{:input('group_id')}"
>
<button
type=
"submit"
class=
"btn btn-info btn-raised btn-sm ajax-post col-md-2"
target-form=
"add-user"
>
新 增
</button>
</div>
</form>
</div>
</div>
</div>
</div>
{/block}
\ No newline at end of file
application/index/view/auth/roleedit.html
0 → 100644
View file @
059a9d3c
{extend name="public/base"/}
{block name="style"}{/block}
{block name="main"}
{present name="group_id"}
<div
class=
"builder-tabs builder-form-tabs"
>
<ul
class=
"nav nav-tabs"
>
<li
class=
"active"
><a
href=
"{:url('role_edit',['group_id'=>$group_id])}"
>
角色信息
</a></li>
<li
class=
""
><a
href=
"{:url('access',['group_id'=>$group_id])}"
>
权限分配
</a></li>
<li
class=
""
><a
href=
"{:url('accessUser',['group_id'=>$group_id])}"
>
成员授权
</a></li>
</ul>
<div
class=
"form-group"
></div>
</div>
{/present}
<div
class=
"builder formbuilder-box panel-body bg-color-fff"
>
<div
class=
"row"
>
<div
class=
"col-md-7"
>
<form
action=
""
method=
"post"
class=
"form-builder form-horizontal"
>
<fieldset>
{notempty name="info"}
<input
type=
"hidden"
name=
"id"
value=
"{$info.id}"
>
{/notempty}
<div
class=
"form-group"
>
<label
for=
"title"
class=
"col-md-2 control-label"
>
名称:
</label>
<div
class=
"col-md-10"
>
<input
type=
"text"
class=
"form-control"
name=
"title"
placeholder=
"创建的角色名称"
value=
"{$info.title|default=''}"
>
<span
class=
"material-input"
></span>
</div>
</div>
<div
class=
"form-group item_description"
>
<label
for=
"description"
class=
"col-md-2 control-label"
>
描述:
</label>
<div
class=
"col-md-10"
>
<textarea
name=
"description"
class=
"form-control"
length=
"120"
rows=
'5'
>
{$info.description|default=''}
</textarea>
<span
class=
"material-input"
></span>
</div>
</div>
<div
class=
"form-group"
>
<div
class=
"col-md-12 col-md-offset-2"
>
<div
class=
"col-md-3"
><button
class=
"btn btn-block btn-primary submit ajax-post"
type=
"submit"
target-form=
"form-builder"
>
确定
</button></div>
<div
class=
"col-md-3"
><button
class=
"btn btn-block btn-default return"
onclick=
"javascript:history.back(-1);return false;"
>
返回
</button></div>
</div>
</div>
</fieldset>
</form>
</div>
</div>
</div>
{/block}
\ No newline at end of file
application/route.php
View file @
059a9d3c
...
@@ -73,6 +73,9 @@ Route::group('index', [
...
@@ -73,6 +73,9 @@ Route::group('index', [
'getVersionList'
=>
[
'index/version/getVersionList'
,[
'method'
=>
'post'
]],
'getVersionList'
=>
[
'index/version/getVersionList'
,[
'method'
=>
'post'
]],
'addVersion'
=>
[
'index/version/addVersion'
,[
'method'
=>
'post'
]],
'addVersion'
=>
[
'index/version/addVersion'
,[
'method'
=>
'post'
]],
'getAuth'
=>
[
'index/auth/getAuth'
,
[
'method'
=>
'get'
]],
//权限列表
'getAuth'
=>
[
'index/auth/getAuth'
,
[
'method'
=>
'get'
]],
//权限列表
'access'
=>
[
'index/auth/access'
,
[
'method'
=>
'get'
]],
//权限列表
'roleedit'
=>
[
'index/auth/roleedit'
,
[
'method'
=>
'get'
]],
//权限列表
'accessUser'
=>
[
'index/auth/accessUser'
,
[
'method'
=>
'get'
]],
//权限列表
]);
]);
...
...
public/resource/template/auth_template_tpl.html
View file @
059a9d3c
...
@@ -11,9 +11,9 @@
...
@@ -11,9 +11,9 @@
<
/td
>
<
/td
>
<
td
>
[
%=
it
[
item
][
"status"
]
%
]
<
/td
>
<
td
>
[
%=
it
[
item
][
"status"
]
%
]
<
/td
>
<
td
>
<
td
>
<
a
title
=
"编辑"
class
=
"btn btn-success btn-xs"
href
=
"/admin.php/
admin/auth/roleedit/group_id/1
.html"
style
=
"margin-right:6px;"
>
编辑
<
/a
>
<
a
title
=
"编辑"
class
=
"btn btn-success btn-xs"
href
=
"/admin.php/
index/access?id=[%= it[item]['id']%]
.html"
style
=
"margin-right:6px;"
>
编辑
<
/a
>
<
a
title
=
"权限分配"
class
=
"btn btn-info btn-xs"
href
=
"/admin.php/
admin/auth/access/group_id/1
.html"
style
=
"margin-right:6px;"
>
权限分配
<
/a
>
<
a
title
=
"权限分配"
class
=
"btn btn-info btn-xs"
href
=
"/admin.php/
index/accessUser?id=[%= it[item]['id']%]
.html"
style
=
"margin-right:6px;"
>
权限分配
<
/a
>
<
a
title
=
"成员授权"
class
=
"btn btn-primary btn-xs"
href
=
"/admin.php/
admin/auth/accessuser/group_id/1
.html"
style
=
"margin-right:6px;"
>
成员授权
<
/a
>
<
a
title
=
"成员授权"
class
=
"btn btn-primary btn-xs"
href
=
"/admin.php/
index/roleedit?id=[%= it[item]['id']%]
.html"
style
=
"margin-right:6px;"
>
成员授权
<
/a
>
<
/td
>
<
/td
>
<
/tr
>
<
/tr
>
[
%
}
%
]
[
%
}
%
]
...
...
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