123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333 |
- {include file="public/header" /}
- <body class="layui-layout-body">
- <div id="LAY_app">
- <div class="layui-layout layui-layout-admin">
- <div class="layui-header">
- <!-- 头部区域 -->
- <ul class="layui-nav layui-layout-left">
- <li class="layui-nav-item layadmin-flexible" lay-unselect="">
- <a href="javascript:;" layadmin-event="flexible" title="侧边伸缩">
- <i class="layui-icon layui-icon-shrink-right" id="LAY_app_flexible"></i>
- </a>
- </li>
- <!-- <li class="layui-nav-item layui-hide-xs" lay-unselect="">
- <a href="http://www.layui.com/admin/" target="_blank" title="前台">
- <i class="layui-icon layui-icon-website"></i>
- </a>
- </li> -->
- <li class="layui-nav-item" lay-unselect="">
- <a href="javascript:;" layadmin-event="refresh" title="刷新">
- <i class="layui-icon layui-icon-refresh-3"></i>
- </a>
- </li>
- <!-- <li class="layui-nav-item layui-hide-xs" lay-unselect="">
- <input type="text" placeholder="搜索..." autocomplete="off" class="layui-input layui-input-search"
- layadmin-event="serach" lay-action="template/search.html?keywords=">
- </li> -->
- </ul>
- <ul class="layui-nav layui-layout-right" lay-filter="layadmin-layout-right" id="view">
- <!-- <li class="layui-nav-item" lay-unselect="">
- <a lay-href="../src/views/app/message/index.html" layadmin-event="message" lay-text="消息中心">
- <i class="layui-icon layui-icon-notice"></i> -->
- <!-- 如果有新消息,则显示小圆点 -->
- <!-- <span class="layui-badge-dot"></span>
- </a>
- </li> -->
- <li class="layui-nav-item layui-hide-xs" lay-unselect="">
- <a href="javascript:;" layadmin-event="note" title="便签">
- <i class="layui-icon layui-icon-note"></i>
- </a>
- </li>
- <li class="layui-nav-item layui-hide-xs" lay-unselect="">
- <a href="javascript:;" layadmin-event="fullscreen" title="全屏">
- <i class="layui-icon layui-icon-screen-full"></i>
- </a>
- </li>
- <li class="layui-nav-item" lay-unselect="" >
- <img src="{$portrait}" data-original="{$portrait}" class="layui-circle layui-table-img" onerror="this.src='/static/admin/images/head_default.gif'" alt="{:session('rolename')}" title="{:session('rolename')}" >
- </li>
- <li class="layui-nav-item" lay-unselect="">
- <a href="javascript:;">
- <cite>{$username}</cite>
- <span class="layui-nav-more"></span></a>
- <dl class="layui-nav-child">
- <!--<dd><a href="../src/views/set/user/info.html"><i class="fa fa-user-circle"></i> 基本资料</a></dd>-->
- <dd><a href="javascript:;" onclick="wk.layer_show1('基本资料',$('#pInfo'),550,405)"><i class="fa fa-user-circle-o"></i> 基本资料</a></dd>
- <dd><a href="javascript:;" onclick="wk.layer_show1('修改头像',$('#headCrop'),700,570)"><i class="fa fa-crop"></i> 修改头像</a></dd>
- <dd><a href="javascript:;" onclick="wk.layer_show1('修改密码',$('#changePwd'),500,320);"><i class="fa fa-unlock-alt"></i> 修改密码</a></dd>
- <dd><a href="javascript:;" onclick="cache()"><i class="fa fa-history"></i> 清除缓存</a></dd>
- <hr>
- <dd style="text-align: center;"><a href="javascript:;" onclick="loginOut()"><i class="fa fa-sign-out"></i> 退出</a></dd>
- </dl>
- </li>
- <li class="layui-nav-item layui-hide-xs" lay-unselect="">
- <a href="javascript:;" layadmin-event="theme" title="皮肤">
- <i class="layui-icon layui-icon-theme"></i>
- </a>
- </li>
- <!--<li class="layui-nav-item layui-hide-xs" lay-unselect="">-->
- <!--<a href="javascript:;" layadmin-event="about"><i-->
- <!--class="layui-icon layui-icon-more-vertical"></i></a>-->
- <!--</li>-->
- <li class="layui-nav-item layui-show-xs-inline-block layui-hide-sm" lay-unselect="">
- <a href="javascript:;" layadmin-event="more"><i class="layui-icon layui-icon-more-vertical"></i></a>
- </li>
- </ul>
- </div>
- <!--侧边菜单-->
- <div class="layui-side layui-side-menu">
- <div class="layui-side-scroll">
- <div class="layui-logo">
- <span>layui</span>
- </div>
- <ul class="layui-nav layui-nav-tree " id="LAY-system-side-menu" lay-filter="layadmin-system-side-menu" lay-shrink="all">
- {if !empty($menu)}
- {foreach name="menu" item="vo"}
- <li data-name="home" class="layui-nav-item">
- {if condition="$vo.name eq '#'"}
- <a href="javascript:;" lay-tips="{$vo.title}" lay-direction="2">
- <i class="{$vo.css} layui-font"></i>
- <cite>{$vo.title}</cite>
- <span class="layui-nav-more"></span>
- </a>
- {else /}
- <a href="javascript:;" lay-href="{$vo.href}" lay-tips="{$vo.title}"
- lay-direction="2">
- <i class="{$vo.css} layui-font"></i>
- <cite>{$vo.title}</cite>
- </a>
- {/if}
- {if condition="$vo.name eq '#'"}
- <dl class="layui-nav-child">
- {if !empty($vo['child'])}
- {foreach name="$vo['child']" item="v"}
- {if condition="$v.name neq '##'"}
- <dd data-name="console">
- <a lay-href="{$v.href}">{$v.title}</a>
- </dd>
- {else /}
- <dd data-name="grid">
- <a href="javascript:;">{$v.title}<span class="layui-nav-more"></span></a>
- <dl class="layui-nav-child">
- {if !empty($v['child'])}
- {foreach name="$v['child']" item="z"}
- <dd data-name="list"><a lay-href="{$z.href}">{$z.title}</a></dd>
- {/foreach}
- {/if}
- </dl>
- </dd>
- {/if}
- {/foreach}
- {/if}
- </dl>
- {/if}
- </li>
- {/foreach}
- {/if}
- </ul>
- </div>
- </div>
- <!-- 页面标签 -->
- <div class="layadmin-pagetabs" id="LAY_app_tabs">
- <div class="layui-icon layadmin-tabs-control layui-icon-prev" layadmin-event="leftPage"></div>
- <div class="layui-icon layadmin-tabs-control layui-icon-next" layadmin-event="rightPage"></div>
- <div class="layui-icon layadmin-tabs-control layui-icon-down">
- <ul class="layui-nav layadmin-tabs-select" lay-filter="layadmin-pagetabs-nav">
- <li class="layui-nav-item" lay-unselect="">
- <a href="javascript:;"><span class="layui-nav-more"></span></a>
- <dl class="layui-nav-child layui-anim-fadein">
- <dd layadmin-event="closeThisTabs"><a href="javascript:;">关闭当前标签页</a></dd>
- <dd layadmin-event="closeOtherTabs"><a href="javascript:;">关闭其它标签页</a></dd>
- <dd layadmin-event="closeAllTabs"><a href="javascript:;">关闭全部标签页</a></dd>
- </dl>
- </li>
- </ul>
- </div>
- <div class="layui-tab" lay-unauto="" lay-allowclose="true" lay-filter="layadmin-layout-tabs">
- <ul class="layui-tab-title" id="LAY_app_tabsheader">
- <li lay-id="../src/views/home/console.html" lay-attr="../src/views/home/console.html" class="layui-this"><i class="layui-icon layui-icon-home"></i> 首页<i class="layui-icon layui-unselect layui-tab-close">ဆ</i>
- </li>
- </ul>
- </div>
- </div>
- <!-- 主体内容 -->
- <div class="layui-body" id="LAY_app_body">
- <div class="layadmin-tabsbody-item layui-show">
- <iframe src="{:url('Index/indexPage')}" frameborder="0" class="layadmin-iframe"></iframe>
- </div>
- </div>
- <!-- 辅助元素,一般用于移动设备下遮罩 -->
- <div class="layadmin-body-shade" layadmin-event="shade"></div>
- </div>
- </div>
- {include file="public/footer" /}
- <!--修改密码-->
- <div id="changePwd" style="display:none;">
- <div class="layui-fluid layui-col-xs12">
- <div class="layui-card-body layui-form layui-form-pane">
- <div class="layui-row layui-form-item ">
- <div class="layui-form-item">
- <label class="layui-form-label">当前密码</label>
- <div class="layui-input-block">
- <input type="password" name="old_pwd" placeholder="输入当前密码" lay-verify="required|oldpwd" class="layui-input" autocomplete="off"/>
- </div>
- </div>
- <div class="layui-form-item">
- <label class="layui-form-label">新密码</label>
- <div class="layui-input-block">
- <input type="password" name="new_pwd" placeholder="输入新密码" lay-verify="required|newpwd" class="layui-input" autocomplete="off"/>
- </div>
- </div>
- <div class="layui-form-item">
- <label class="layui-form-label">确认密码</label>
- <div class="layui-input-block">
- <input type="password" name="r_pwd" placeholder="输入确认密码" lay-verify="required|rpwd" class="layui-input" autocomplete="off"/>
- </div>
- </div>
- <div class="layui-form-item">
- <div class="layui-input-block">
- <button class="layui-btn" lay-submit="" lay-filter="component-form-element">确认修改
- </button>
- <button class="layui-btn layui-btn-primary" onclick="layer.closeAll()">关闭</button>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <!--个人信息-->
- <div id="pInfo" style="display:none;">
- <div class="layui-fluid layui-col-xs12">
- <div class="layui-card-body layui-form layui-form-pane">
- <div class="layui-row layui-form-item ">
- <div class="layui-form-item">
- <label class="layui-form-label">用户名</label>
- <div class="layui-input-block">
- <input type="text" class="layui-input" style="cursor:not-allowed;" value="{:session('username')}" disabled/>
- </div>
- </div>
- <div class="layui-form-item">
- <label class="layui-form-label">角 色</label>
- <div class="layui-input-block">
- <input type="text" class="layui-input" style="cursor:not-allowed;" value="{:session('rolename')}" disabled/>
- </div>
- </div>
- <div class="layui-form-item">
- <label class="layui-form-label">手机号</label>
- <div class="layui-input-block">
- <input type="text" class="layui-input" style="cursor:not-allowed;" value="{:session('phone')}" disabled/>
- </div>
- </div>
- <div class="layui-form-item layui-form-text">
- <label class="layui-form-label">描 述</label>
- <div class="layui-input-block">
- <textarea class="layui-textarea"style="cursor:not-allowed;resize:none" disabled>{:session('describe')}</textarea>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <script type="text/javascript" src="__JS__/plugins/cropper/Crop.js"></script>
- <script>
- //裁剪后的处理
- $("#sureCut").on("click",function () {
- if ($("#tailoringImg").attr("src") == null ){
- layer.msg('请先选择头像',{anim:6})
- }else{
- var cas = $('#tailoringImg').cropper('getCroppedCanvas');//获取被裁剪后的canvas
- var base64url = cas.toDataURL('image/png'); //转换为base64地址形式
- //关闭裁剪框
- layer.closeAll();
- $.ajax({
- url : "{:url('Upload/updateFace')}",
- type : "post",
- dataType : "json",
- data:"base64url="+base64url+"&id={:session('uid')}",
- success : function(data) {
- if(data.code == 200){
- wk.success(data.msg,'window.location.reload()')
- }else if(data.code == 100){
- wk.error(data.msg);
- }
- }
- });
- }
- });
- layui.use(['form'], function() {
- var form = layui.form;
- form.verify({
- oldpwd:function(value,item){
- var checkResult = "";
- $.ajax({
- url:"{:url('User/editPwd')}",
- type:'post',
- data:"old_pwd="+value +"&type=checkPassword",
- async: false,//必须同步
- success:function(res){
- if(res.code == 100){
- checkResult = "当前密码错误";
- }
- }
- })
- return checkResult;
- },
- newpwd: [/^[\S]{6,16}$/,'密码必须6到16位,且不能出现空格'],
- rpwd:function(value,item){
- if(!/^[\S]{6,16}$/.test(value)){
- return '密码必须6到16位,且不能出现空格';
- }
- var newpwd = $('input[name=new_pwd]').val();
- if(newpwd != value){
- return "两次输入密码不一致";
- }
- }
- });
- form.on('submit(component-form-element)', function (data) {
- $('.layui-btn').addClass('layui-disabled').attr('disabled','disabled');
- $.ajax({
- url:"{:url('User/editPwd')}",
- type:'post',
- dataType:'json',
- data:data.field,
- success:function(res){
- if (res.code == 200) {
- wk.success(res.msg,'',"{:url('admin/Login/loginOut')}");
- } else {
- wk.error(res.msg,'$(".layui-btn").removeClass(\'layui-disabled\').removeAttr(\'disabled\')');
- }
- }
- })
- });
- });
- var loginOut = function(){
- layer.confirm('你确定要退出吗?', {icon: 3,title:'提示'}, function(index){
- layer.close(index);
- window.location.href="{:url('admin/login/loginOut')}";
- });
- }
- //清除缓存
- var cache = function(){
- layer.confirm('你确定要清除缓存吗?', {icon: 3, title:'提示'}, function(index){
- $.getJSON("{:url('admin/index/clear')}",function(res){
- if(res.code == 200){
- wk.success(res.msg);
- }else if(res.code == 100){
- wk.error(res.msg);
- }
- });
- })
- }
- </script>
- </body>
- </html>
|