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}),o(".admin-header-lock-input").focus()}function i(){var e=window.sessionStorage.getItem("skin");e&&("自定义"!=window.sessionStorage.getItem("skinValue")?o("body").addClass(window.sessionStorage.getItem("skin")):(o(".layui-layout-admin .layui-header").css("background-color",e.split(",")[0]),o(".layui-bg-black").css("background-color",e.split(",")[1]),o(".hideMenu").css("background-color",e.split(",")[2])))}var a=layui.form,o=layui.jquery,n=void 0===parent.layer?layui.layer:top.layer;/http(s*):\/\//.test(location.href)||n.alert("请先将项目部署到 localhost 下再进行访问【建议通过tomcat、webstorm、hb等方式运行，不建议通过iis方式运行】，否则部分数据将无法显示"),o(".lockcms").on("click",function(){window.sessionStorage.setItem("lockcms",!0),e()}),"true"==window.sessionStorage.getItem("lockcms")&&e(),o("body").on("click","#unlock",function(){if(""==o(this).siblings(".admin-header-lock-input").val())n.msg("请输入解锁密码！"),o(this).siblings(".admin-header-lock-input").focus();else{var e=o("#lockPwd").val();o.ajax({url:"ajax.php?act=lock",type:"post",data:{lockPwd:e},dataType:"json",success:function(e){"ok"==e.data.msg?(window.sessionStorage.setItem("lockcms",!1),o(this).siblings(".admin-header-lock-input").val(""),n.closeAll("page")):(n.msg("密码错误，请重新输入！"),o(this).siblings(".admin-header-lock-input").val("").focus())}})}}),o(document).on("keydown",function(e){e=e||window.event;13==e.keyCode&&o("#unlock").click()}),o(".signOut").click(function(){window.sessionStorage.removeItem("menu"),menu=[],window.sessionStorage.removeItem("curmenu")}),i(),o(".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")&&o(".skins_box input[value="+window.sessionStorage.getItem("skinValue")+"]").attr("checked","checked"),a.render(),o(".skins_box").removeClass("layui-hide"),o(".skins_box .layui-form-radio").on("click",function(){var e;"橙色"==o(this).find("div").text()?e="orange":"蓝色"==o(this).find("div").text()?e="blue":"默认"==o(this).find("div").text()&&(e=""),o(".topColor,.leftColor,.menuColor").val(""),o("body").removeAttr("class").addClass("main_body "+e),o(".skinCustom").removeAttr("style"),o(".layui-bg-black,.hideMenu,.layui-layout-admin .layui-header").removeAttr("style")}),o(".topColor").blur(function(){o(".layui-layout-admin .layui-header").css("background-color",o(this).val()+" !important")}),o(".leftColor").blur(function(){o(".layui-bg-black").css("background-color",o(this).val()+" !important")}),o(".menuColor").blur(function(){o(".hideMenu").css("background-color",o(this).val()+" !important")}),a.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")}),a.on("submit(noChangeSkin)",function(){o("body").removeAttr("class").addClass("main_body "+window.sessionStorage.getItem("skin")),o(".layui-bg-black,.hideMenu,.layui-layout-admin .layui-header").removeAttr("style"),i(),n.closeAll("page")})},cancel:function(){o("body").removeAttr("class").addClass("main_body "+window.sessionStorage.getItem("skin")),o(".layui-bg-black,.hideMenu,.layui-layout-admin .layui-header").removeAttr("style"),i()}})})});