123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115 |
- <!DOCTYPE html>
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="keywords" content="">
- <meta name="description" content="">
- <title text="主页"></title>
- <link rel="stylesheet" href="component/pear/css/pear.css">
- <link rel="stylesheet" href="admin/css/load.css"/>
- <link rel="stylesheet" href="admin/css/admin.css"/>
- </head>
- <!-- 结 构 代 码 -->
- <body class="layui-layout-body pear-admin">
- <!-- 布 局 框 架 -->
- <div class="layui-layout layui-layout-admin">
- <div class="layui-header">
- <!-- 顶 部 左 侧 功 能 -->
- <ul class="layui-nav layui-layout-left">
- <li class="collaspe layui-nav-item"><a href="#" class="layui-icon layui-icon-shrink-right"></a></li>
- <li class="refresh layui-nav-item"><a href="#" class="layui-icon layui-icon-refresh-1" title="刷新页面" loading=600></a></li>
- </ul>
- <!-- 顶 部 右 侧 菜 单 -->
- <div id="control" class="layui-layout-control"></div>
- <ul class="layui-nav layui-layout-right">
- <li class="layui-nav-item layui-hide-xs"><a href="#" class="fullScreen layui-icon layui-icon-screen-full"></a></li>
- <li class="layui-nav-item layui-hide-xs"><a href="http://www.baidu.com" class="layui-icon layui-icon-website"></a></li>
- <li class="layui-nav-item">
- <!-- 头 像 -->
- <a href="javascript:;">
- <img src="admin/images/head.jpg" class="layui-nav-img">
- </a>
- <!-- 功 能 菜 单 -->
- <dl class="layui-nav-child">
- <dd style="cursor: pointer;">
- <a user-menu-url="view/system/user/userInfo.html" user-menu-id="9999" user-menu-title="基本资料">基本资料</a>
- </dd>
- <dd>
- <a href="javascript:void(0);" class="logout">注销登录</a>
- </dd>
- </dl>
- </li>
- <li class="layui-nav-item setting"><a href="#" class="layui-icon layui-icon-more-vertical"></a></li>
- </ul>
- </div>
- <!-- 侧 边 区 域 -->
- <div class="layui-side layui-bg-black">
- <!-- 顶 部 图 标 -->
- <div class="layui-logo">
- <img class="logo">
- <span class="title"></span>
- </div>
- <!-- 侧 边 菜 单 -->
- <div class="layui-side-scroll">
- <div id="sideMenu"></div>
- </div>
- </div>
- <div class="layui-body">
- <div id="content"></div>
- </div>
- </div>
- <!-- 遮 盖 层 -->
- <div class="pear-cover"></div>
- <!-- 加 载 动 画-->
- <div class="loader-main">
- <div class="loader"></div>
- </div>
- <!-- 移 动 端 便 捷 操 作 -->
- <div class="pear-collasped-pe collaspe">
- <a class="layui-icon layui-icon-shrink-right" href="#"></a>
- </div>
- <!-- 依 赖 脚 本 -->
- <script src="component/layui/layui.js"></script>
- <script src="component/pear/pear.js"></script>
- <script src="component/js/jquery.min.js"></script>
- <script>
- layui.use(['jquery', 'admin', 'layer', 'request'], function () {
- var $ = layui.jquery,
- layer = layui.layer,
- admin = layui.admin,
- request = layui.request;
- // 获取用户信息,用户名、昵称、头像等
- request.http({
- url: "/system/user/v1/userInfo",
- dataType: 'json',
- success: function (result) {
- $(".layui-nav-img").attr("src", (result.data.avatar ? request.getAdminServerUrl() + result.data.avatar : "admin/images/head.jpg"));
- $(".layui-nav-img").parent().append(result.data.realName);
- }
- });
- admin.render();
- $("body").on("click", ".logout", function() {
- var loading = layer.load(2, {shade: [0.3, '#333']});
- request.http({
- type: 'post',
- url: '/logout',
- dataType: 'json',
- success: function (result) {
- layer.close(loading);
- if (result.success) {
- layui.data('user', null); // 清空本地存储
- layer.msg("注销成功", {icon: 1, time: 1200}, function() {
- location.href = "/";
- });
- }
- }
- });
- })
- })
- </script>
- </body>
- </html>
|