Commit 231b7e58 by 杨树贤

登出页面模块

parent 35a7b081
......@@ -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
......
<?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;
}
}
......@@ -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;
......
@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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment