Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
workbiu-admin
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gxx
workbiu-admin
Commits
e77f8f31
Commit
e77f8f31
authored
Nov 28, 2017
by
gxx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加管理员时的页面数据还未完成
parent
fa4196da
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
263 additions
and
18 deletions
+263
-18
RoleServiceContract.php
app/Contracts/RoleServiceContract.php
+20
-0
AdminController.php
app/Http/Controllers/AdminController.php
+18
-1
PermissionController.php
app/Http/Controllers/PermissionController.php
+10
-0
RoleController.php
app/Http/Controllers/RoleController.php
+23
-0
RoleServiceProvider.php
app/Providers/RoleServiceProvider.php
+33
-0
RoleService.php
app/Services/RoleService.php
+46
-0
app.php
config/app.php
+1
-0
roletables.blade.php
resources/views/admin/role/roletables.blade.php
+76
-0
sidebar.blade.php
resources/views/admin/sidebar.blade.php
+19
-15
web.php
routes/web.php
+17
-2
No files found.
app/Contracts/RoleServiceContract.php
0 → 100644
View file @
e77f8f31
<?php
/**
* Created by PhpStorm.
* User: Aladin
* Date: 2017/11/28
* Time: 19:16
*/
namespace
App\Contracts
;
interface
RoleServiceContract
{
public
function
add
();
public
function
delete
();
public
function
update
();
public
function
get
();
public
function
getAll
();
}
app/Http/Controllers/AdminController.php
View file @
e77f8f31
...
...
@@ -3,15 +3,17 @@
namespace
App\Http\Controllers
;
use
App\Contracts\AdminServiceContract
;
use
App\Contracts\RoleServiceContract
;
use
Illuminate\Http\Request
;
use
Illuminate\Support\Facades\Validator
;
class
AdminController
extends
Controller
{
public
function
__construct
(
AdminServiceContract
$adminHandle
)
public
function
__construct
(
AdminServiceContract
$adminHandle
,
RoleServiceContract
$roleHandle
)
{
$this
->
mAdmin
=
$adminHandle
;
$this
->
mRole
=
$roleHandle
;
}
...
...
@@ -28,6 +30,16 @@ class AdminController extends Controller
}
}
public
function
addPage
()
{
dd
(
2
);
// $roles = $this->mRole->getAll();
// if ($roles){
//
// }
}
public
function
add
(
Request
$request
)
{
$rules
=
[
...
...
@@ -53,6 +65,11 @@ class AdminController extends Controller
}
public
function
get
(
Request
$request
)
{
$id
=
$request
->
id
;
}
public
function
getAll
()
...
...
app/Http/Controllers/PermissionController.php
0 → 100644
View file @
e77f8f31
<?php
namespace
App\Http\Controllers
;
use
Illuminate\Http\Request
;
class
PermissionController
extends
Controller
{
//
}
app/Http/Controllers/RoleController.php
0 → 100644
View file @
e77f8f31
<?php
namespace
App\Http\Controllers
;
use
App\Contracts\RoleServiceContract
;
use
Illuminate\Http\Request
;
class
RoleController
extends
Controller
{
public
function
__construct
(
RoleServiceContract
$roleHandle
)
{
$this
->
mRole
=
$roleHandle
;
}
public
function
getAll
()
{
$roles
=
$this
->
mRole
->
getAll
();
return
view
(
'admin/role/roletables'
,
compact
(
'roles'
));
}
}
app/Providers/RoleServiceProvider.php
0 → 100644
View file @
e77f8f31
<?php
namespace
App\Providers
;
use
App\Services\RoleService
;
use
Illuminate\Support\ServiceProvider
;
class
RoleServiceProvider
extends
ServiceProvider
{
/**
* Bootstrap the application services.
*
* @return void
*/
public
function
boot
()
{
//
}
/**
* Register the application services.
*
* @return void
*/
public
function
register
()
{
//绑定服务与接口关系
$this
->
app
->
singleton
(
"App\Contracts\RoleServiceContract"
,
function
(){
return
new
RoleService
();
});
}
}
app/Services/RoleService.php
0 → 100644
View file @
e77f8f31
<?php
/**
* Created by PhpStorm.
* User: Aladin
* Date: 2017/11/28
* Time: 19:30
*/
namespace
App\Services
;
use
App\Contracts\RoleServiceContract
;
use
App\Models\Role
;
class
RoleService
implements
RoleServiceContract
{
public
function
add
()
{
// TODO: Implement add() method.
}
public
function
delete
()
{
// TODO: Implement delete() method.
}
public
function
update
()
{
// TODO: Implement update() method.
}
public
function
get
()
{
// TODO: Implement get() method.
}
public
function
getAll
()
{
$roles
=
Role
::
all
();
if
(
$roles
->
isEmpty
()){
return
null
;
}
return
$roles
;
}
}
\ No newline at end of file
config/app.php
View file @
e77f8f31
...
...
@@ -185,6 +185,7 @@ return [
App\Providers\UserServiceProvider
::
class
,
App\Providers\StatisticsServiceProvider
::
class
,
App\Providers\AdminServiceProvider
::
class
,
App\Providers\RoleServiceProvider
::
class
,
Zizaco\Entrust\EntrustServiceProvider
::
class
,
Orangehill\Iseed\IseedServiceProvider
::
class
,
...
...
resources/views/admin/role/roletables.blade.php
0 → 100644
View file @
e77f8f31
@
extends
(
'admin/dashboard'
)
@
section
(
'content'
)
<!--
Content
Header
(
Page
header
)
-->
<
section
class
=
"content-header"
>
<
h1
>
角色列表
{{
--<
small
>
advanced
tables
</
small
>--
}}
</
h1
>
<
ol
class
=
"breadcrumb"
>
<
li
><
a
href
=
"#"
><
i
class
=
"fa fa-dashboard"
></
i
>
Home
</
a
></
li
>
<
li
><
a
href
=
"#"
>
Tables
</
a
></
li
>
<
li
class
=
"active"
>
Data
tables
</
li
>
</
ol
>
</
section
>
<!--
Main
content
-->
<
section
class
=
"content"
>
<
div
class
=
"row"
>
<
div
class
=
"col-xs-12"
>
<
div
class
=
"box"
>
<
div
class
=
"box-header"
>
{{
--<
h3
class
=
"box-title"
>
Hover
Data
Table
</
h3
>--
}}
</
div
>
<!--
/.
box
-
header
-->
<
div
class
=
"box-body"
>
<
a
href
=
"
{
{route('role.addPage')}
}
"
class
=
"btn btn-info"
>
添加角色
</
a
>
<
br
>
<
br
>
<
br
>
<
table
id
=
"example2"
class
=
"table table-bordered table-hover"
>
<
thead
>
<
tr
>
<
th
>
ID
</
th
>
<
th
>
name
</
th
>
<
th
>
display_name
</
th
>
<
th
>
description
</
th
>
<
th
>
操作
</
th
>
</
tr
>
</
thead
>
@
if
(
$roles
==
null
)
<
tbody
>
<
tr
>
<
td
colspan
=
"5"
style
=
"text-align: center;color: red"
>
数据暂无
</
td
>
</
tr
>
</
tbody
>
</
table
>
@
else
@
foreach
(
$roles
as
$role
)
<
tbody
>
<
tr
>
<
td
>
{{
$role
[
'id'
]}}
</
td
>
<
td
>
{{
$role
[
'name'
]}}
</
td
>
<
td
>
{{
$role
[
'display_name'
]}}
</
td
>
<
td
>
{{
$role
[
'description'
]}}
</
td
>
<
td
>
<
a
href
=
"
{
{route('role.updatePage',['id'=>$role['id']])}
}
"
class
=
"btn btn-info"
>
编辑
</
a
>
</
td
>
</
tr
>
</
tbody
>
@
endforeach
</
table
>
{{
--
{{
$groups
->
links
()
}}
--
}}
</
div
>
<!--
/.
box
-
body
-->
</
div
>
<!--
/.
box
-->
</
div
>
<!--
/.
col
-->
</
div
>
<!--
/.
row
-->
</
section
>
@
endif
@
endsection
\ No newline at end of file
resources/views/admin/sidebar.blade.php
View file @
e77f8f31
...
...
@@ -56,7 +56,7 @@
</span>
</a>
<ul
class=
"treeview-menu"
>
<li><a
href=
"
#
"
>
管理员列表
</a></li>
<li><a
href=
"
{{route('admin.getAll')}}
"
>
管理员列表
</a></li>
<li><a
href=
"{{route('admin.addPage')}}"
>
添加管理员
</a></li>
</ul>
...
...
@@ -76,15 +76,16 @@
</li>
<li
class=
"treeview"
>
<a
href=
"#"
><i
class=
"fa fa-link"
></i>
<span>
权限
管理
</span>
<a
href=
"#"
><i
class=
"fa fa-link"
></i>
<span>
文件
管理
</span>
<span
class=
"pull-right-container"
>
<i
class=
"fa fa-angle-left pull-right"
></i>
</span>
</a>
<ul
class=
"treeview-menu"
>
<li><a
href=
"#"
>
权限列表
</a></li>
<li><a
href=
"#"
>
新增权限
</a></li>
<li><a
href=
""
>
文件列表
</a></li>
{{--
<li><a
href=
"#"
>
Link in level 2
</a></li>
--}}
</ul>
...
...
@@ -92,15 +93,16 @@
<li
class=
"treeview"
>
<a
href=
"#"
><i
class=
"fa fa-link"
></i>
<span>
文件管理
</span>
<a
href=
"#"
><i
class=
"fa fa-link"
></i>
<span>
系统设置
</span>
<span
class=
"pull-right-container"
>
<i
class=
"fa fa-angle-left pull-right"
></i>
</span>
</a>
<ul
class=
"treeview-menu"
>
<li><a
href=
""
>
文件列表
</a></li>
{{--
<li><a
href=
"#"
>
Link in level 2
</a></li>
--}}
<li><a
href=
"{{route('sms')}}"
>
短信通知余额
</a></li>
</ul>
</li>
...
...
@@ -110,13 +112,15 @@
<li
class=
"treeview"
>
<a
href=
"#"
><i
class=
"fa fa-link"
></i>
<span>
系统设置
</span>
<a
href=
"#"
><i
class=
"fa fa-link"
></i>
<span>
权限管理
</span>
<span
class=
"pull-right-container"
>
<i
class=
"fa fa-angle-left pull-right"
></i>
</span>
</a>
<ul
class=
"treeview-menu"
>
<li><a
href=
"{{route('sms')}}"
>
短信通知余额
</a></li>
<li><a
href=
"#"
>
权限列表
</a></li>
<li><a
href=
"#"
>
角色列表
</a></li>
{{--
<li><a
href=
"#"
>
Link in level 2
</a></li>
--}}
</ul>
</li>
...
...
routes/web.php
View file @
e77f8f31
...
...
@@ -15,6 +15,7 @@
// return view('admin/dashboard');
//});
//Route::get('/','StatisticsController@newUser')->name('/');
Route
::
group
([
'prefix'
=>
'error'
],
function
(){
...
...
@@ -40,7 +41,7 @@
return
view
(
'login'
);
})
->
name
(
'a'
);
Route
::
post
(
'login'
,
'AdminController@login'
)
->
name
(
'login'
);
route
::
get
(
'add_page'
,
function
(){
return
view
(
'admin/admin/addadmin'
);
}
)
->
name
(
'admin.addPage'
);
route
::
get
(
'add_page'
,
'AdminController@addPage'
)
->
name
(
'admin.addPage'
);
route
::
get
(
'add'
,
'AdminController@add'
)
->
name
(
'admin.add'
);
route
::
get
(
'get_all'
,
'AdminController@getAll'
)
->
name
(
'admin.getAll'
);
route
::
get
(
'update_page'
,
function
(){
return
view
(
'admin/admin/update'
);
})
->
name
(
'admin.updatePage'
);
...
...
@@ -95,9 +96,23 @@
Route
::
get
(
'user_engagement'
,
'StatisticsController@UserEngagement'
)
->
name
(
'statistics.UserEngagement'
);
Route
::
get
(
'total'
,
'StatisticsController@Total'
)
->
name
(
'statistics.Total'
);
// 统计 首页
//Route::get('statistics','StatisticsController@newUser')->name('statistics');
Route
::
get
(
'/'
,
'StatisticsController@newUser'
)
->
name
(
'/'
);
Route
::
get
(
'statistics'
,
'StatisticsController@newUser'
)
->
name
(
'statistics'
);
// 短信
Route
::
get
(
'sms'
,
'SMSController@surplus'
)
->
name
(
'sms'
);
});
Route
::
group
([
'prefix'
=>
'role'
],
function
(){
Route
::
get
(
'add_page'
,
function
(){
return
view
(
'admin/role/add'
);
})
->
name
(
'role.addPage'
);
Route
::
get
(
'update_page'
,
'RoleController@ '
)
->
name
(
'role.updatePage'
);
Route
::
get
(
'get_all'
,
'RoleController@getAll'
)
->
name
(
'role.getAll'
);
});
Route
::
get
(
'/'
,
'StatisticsController@newUser'
)
->
name
(
'/'
);
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