var cacheStr=window.sessionStorage.getItem("cache"),oneLoginStr=window.sessionStorage.getItem("oneLogin");layui.use(["form","jquery","layer"],function(){function e(){n.open({title:!1,type:1,content:'<div class="admin-header-lock" id="lock-box"><div class="admin-header-lock-img"><img src="images/Amoli.png" class="userAvatar"/></div><div class="admin-header-lock-name" id="lockUserName">Amoli私有云</div><div class="input_btn"><input type="password" class="admin-header-lock-input layui-input" autocomplete="off" placeholder="请输入密码解锁.." name="lockPwd" id="lockPwd" /><button class="layui-btn" id="unlock">解锁</button></div><p>登录密码就是锁屏密码</p></div>',closeBtn:0,shade:.9}),a(".admin-header-lock-input").focus()}function i(){var e=window.sessionStorage.getItem("skin");e&&("自定义"!=window.sessionStorage.getItem("skinValue")?a("body").addClass(window.sessionStorage.getItem("skin")):(a(".layui-layout-admin .layui-header").css("background-color",e.split(",")[0]),a(".layui-bg-black").css("background-color",e.split(",")[1]),a(".hideMenu").css("background-color",e.split(",")[2])))}var o=layui.form,a=layui.jquery,n=void 0===parent.layer?layui.layer:top.layer;/http(s*):\/\//.test(location.href)||n.alert("请先将项目部署到 localhost 下再进行访问【建议通过tomcat、webstorm、hb等方式运行，不建议通过iis方式运行】，否则部分数据将无法显示"),a(".lockcms").on("click",function(){window.sessionStorage.setItem("lockcms",!0),e()}),"true"==window.sessionStorage.getItem("lockcms")&&e(),a("body").on("click","#unlock",function(){if(""==a(this).siblings(".admin-header-lock-input").val())n.msg("请输入解锁密码！"),a(this).siblings(".admin-header-lock-input").focus();else{var e=a("#lockPwd").val();a.ajax({url:"ajax.php?act=lock",type:"post",data:{lockPwd:e},dataType:"json",success:function(e){1==e.code?(window.sessionStorage.setItem("lockcms",!1),a(this).siblings(".admin-header-lock-input").val(""),n.closeAll("page")):(n.msg("密码错误，请重新输入！"),a(this).siblings(".admin-header-lock-input").val("").focus())}})}}),a(document).on("keydown",function(e){e=e||window.event;13==e.keyCode&&a("#unlock").click()}),a(".signOut").click(function(){window.sessionStorage.removeItem("menu"),menu=[],window.sessionStorage.removeItem("curmenu")}),i(),a(".changeSkin").click(function(){n.open({title:"更换皮肤",area:["310px","150px"],type:"1",content:'<div class="skins_box"><form class="layui-form"><div class="layui-form-item"><input type="radio" name="skin" value="默认" title="默认" lay-filter="default" checked=""><input type="radio" name="skin" value="橙色" title="橙色" lay-filter="orange"><input type="radio" name="skin" value="蓝色" title="蓝色" lay-filter="blue"></div><div class="layui-form-item skinBtn"><a href="javascript:;" class="layui-btn layui-btn-sm layui-btn-normal" lay-submit="" lay-filter="changeSkin">确定更换</a><a href="javascript:;" class="layui-btn layui-btn-sm layui-btn-primary" lay-submit="" lay-filter="noChangeSkin">我再想想</a></div></form></div>',success:function(e,t){var s;window.sessionStorage.getItem("skin");window.sessionStorage.getItem("skinValue")&&a(".skins_box input[value="+window.sessionStorage.getItem("skinValue")+"]").attr("checked","checked"),o.render(),a(".skins_box").removeClass("layui-hide"),a(".skins_box .layui-form-radio").on("click",function(){var e;"橙色"==a(this).find("div").text()?e="orange":"蓝色"==a(this).find("div").text()?e="blue":"默认"==a(this).find("div").text()&&(e=""),a(".topColor,.leftColor,.menuColor").val(""),a("body").removeAttr("class").addClass("main_body "+e),a(".skinCustom").removeAttr("style"),a(".layui-bg-black,.hideMenu,.layui-layout-admin .layui-header").removeAttr("style")}),a(".topColor").blur(function(){a(".layui-layout-admin .layui-header").css("background-color",a(this).val()+" !important")}),a(".leftColor").blur(function(){a(".layui-bg-black").css("background-color",a(this).val()+" !important")}),a(".menuColor").blur(function(){a(".hideMenu").css("background-color",a(this).val()+" !important")}),o.on("submit(changeSkin)",function(e){"橙色"==e.field.skin?s="orange":"蓝色"==e.field.skin?s="blue":"默认"==e.field.skin&&(s=""),window.sessionStorage.setItem("skin",s),window.sessionStorage.setItem("skinValue",e.field.skin),n.closeAll("page")}),o.on("submit(noChangeSkin)",function(){a("body").removeAttr("class").addClass("main_body "+window.sessionStorage.getItem("skin")),a(".layui-bg-black,.hideMenu,.layui-layout-admin .layui-header").removeAttr("style"),i(),n.closeAll("page")})},cancel:function(){a("body").removeAttr("class").addClass("main_body "+window.sessionStorage.getItem("skin")),a(".layui-bg-black,.hideMenu,.layui-layout-admin .layui-header").removeAttr("style"),i()}})})});