Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
semour
/
semour_admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
231b7e58
authored
Nov 16, 2022
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
登出页面模块
parent
35a7b081
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
76 additions
and
8 deletions
.env
app/Admin/Actions/AdminInfo.php
app/Admin/bootstrap.php
resources/views/admin/navbar-user-panel.blade.php
.env
View file @
231b7e58
...
...
@@ -2,7 +2,7 @@ APP_NAME=Laravel
APP_ENV=local
APP_KEY=base64:Qez7GnqgT9Obb1V+FbzqgYIkkbSUeffZVsZsK+B3lkw=
APP_DEBUG=true
APP_URL=http://
localhost
APP_URL=http://
admin.semourdev.net/admin
LOG_CHANNEL=stack
...
...
app/Admin/Actions/AdminInfo.php
0 → 100644
View file @
231b7e58
<?php
namespace
App\Admin\Actions
;
use
App\Admin\Forms\AdminSetting
as
AdminSettingForm
;
use
Dcat\Admin\Actions\Action
;
use
Dcat\Admin\Widgets\Modal
;
class
AdminInfo
extends
Action
{
public
function
render
()
{
return
<<<HTML
<li class="dropdown dropdown-user nav-item">
<a class="dropdown-toggle nav-link dropdown-user-link" href="#" data-toggle="dropdown">
<div class="user-nav d-sm-flex d-none">
<span class="user-name text-bold-600">{{ request()->user->name }}</span>
<span class="user-status"><i class="fa fa-circle text-success"></i> {{ trans('admin.online') }}</span>
</div>
<span>
<img class="round" src="{{ $user->getAvatar() }}" alt="avatar" height="40" width="40" />
</span>
</a>
<div class="dropdown-menu dropdown-menu-right">
<a href="{{ admin_url('auth/setting') }}" class="dropdown-item">
<i class="feather icon-user"></i> {{ trans('admin.setting') }}
</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="{{ admin_url('auth/logout') }}">
<i class="feather icon-power"></i> {{ trans('admin.logout') }}
</a>
</div>
</li>
HTML;
}
}
app/Admin/bootstrap.php
View file @
231b7e58
...
...
@@ -183,19 +183,21 @@ HTML
if
(
!
Dcat\Admin\Support\Helper
::
isAjaxRequest
())
{
$navbar
->
$method
(
App\Admin\Actions\AdminSetting
::
make
()
->
render
());
}
$navbar
->
right
(
<<<
HTML
HTML
);
// $navbar->right('');
});
admin_inject_section
(
Admin
::
SECTION
[
'NAVBAR_USER_PANEL'
],
function
()
{
return
view
(
'admin.navbar-user-panel'
,
[
'user'
=>
request
()
->
user
]);
});
Admin
::
menu
(
function
(
Menu
$menu
)
{
//权限系统的菜单
$permMenus
=
request
()
->
menus
;
$permMenus
=
(
array
)
$permMenus
;
$permMenus
=
(
array
)
$permMenus
;
$addMenus
=
[];
foreach
(
$permMenus
as
$key
=>
&
$permMenu
)
{
$permMenu
=
(
array
)
$permMenu
;
$permMenu
=
(
array
)
$permMenu
;
//为了区分本系统手动添加的菜单
$key
=
$key
+
1000
;
$permMenu
[
'id'
]
=
$key
+
1
;
...
...
@@ -205,7 +207,7 @@ Admin::menu(function (Menu $menu) {
$addMenus
[]
=
$permMenu
;
if
(
!
empty
(
$permMenu
[
'childs'
]))
{
foreach
(
$permMenu
[
'childs'
]
as
$k
=>
&
$child
)
{
$child
=
(
array
)
$child
;
$child
=
(
array
)
$child
;
//为了让字菜单的id不和父菜单的id冲突
$child
[
'id'
]
=
$k
+
(
$key
+
1
)
*
100
;
$child
[
'parent_id'
]
=
$key
+
1
;
...
...
resources/views/admin/navbar-user-panel.blade.php
0 → 100644
View file @
231b7e58
@
if
(
$user
)
<
li
class
="
dropdown
dropdown
-
user
nav
-
item
">
<a class="
dropdown
-
toggle
nav
-
link
dropdown
-
user
-
link
" href="
#" data-toggle="dropdown">
<
div
class
="
user
-
nav
d
-
sm
-
flex
d
-
none
">
<span class="
user
-
name
text
-
bold
-
600
">{{
$user->name
}}</span>
<span class="
user
-
status
"><i class="
fa
fa
-
circle
text
-
success
"></i> {{ trans('admin.online') }}</span>
</div>
<span>
<img class="
round
" src="
/
vendor
/
dcat
-
admin
/
images
/
default
-
avatar
.
jpg
" alt="
avatar
" height="
40
" width="
40
" />
</span>
</a>
<div class="
dropdown
-
menu
dropdown
-
menu
-
right
">
{{-- <a href="
{{
admin_url
(
'auth/setting'
)
}}
" class="
dropdown
-
item
">--}}
{{-- <i class="
feather
icon
-
user
"></i> {{ trans('admin.setting') }}--}}
{{-- </a>--}}
{{-- <div class="
dropdown
-
divider
"></div>--}}
<a class="
dropdown
-
item
" href="
{{
config
(
'website.login.logout'
)
.
'?redirect='
.
config
(
'app.url'
)
}}
">
<i class="
feather
icon
-
power
"></i> {{ trans('admin.logout') }}
</a>
</div>
</li>
@endif
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