| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- $(document).ready(function() {
- initData();
- initSelectClick();
- });
- function initSelectClick() {
- $("#moduleSelect").click();
- if(isQuickLogin) {
- $("#moduleSelect").next("ul").on("click", "a", function() {
- setTimeout(() => {
- $("#submitBtn").click();
- }, 200);
- })
- }
- }
- /**
- * 解密字符串
- */
- function uncompileStr(str) {
- str = unescape(str);
- var c = String.fromCharCode(str.charCodeAt(0) - str.length);
- for (var i = 1; i < str.length; i++) {
- c += String.fromCharCode(str.charCodeAt(i) - c.charCodeAt(i - 1));
- }
- return c;
- }
- // 是否快速登录标记,为真代表是,反之不是
- var isQuickLogin = false;
- function initData() {
- var y = layui.data("95187");
- var l = layui.data("35624");
- var x = layui.data("13691");
- var t = layui.data("05926");
- if (y.y && l.l && x.x && t.t) {
- $("#iconImg").attr("src", uncompileStr(t.t));
- $("#iconImg").onload = loadIconBorder();
- $("#iconName").html("欢迎, " + uncompileStr(x.x));
- $("#inputUser").val(uncompileStr(y.y));
- $("#inputPassword").remove();
- $("#inputToken").val(uncompileStr(l.l));
- $("#icon").show();
- $("div[group='input']").hide();
- $("button[type='submit']").css("margin-top", "0px");
- isQuickLogin = true;
- } else {
- $("div[group='input']").removeClass("displayHide");
- }
- $("#login-form").fadeIn(200);
- }
- function loadIconBorder() {
- var randomNum = Math.floor(Math.random() * 83);
- if (randomNum > 10 && randomNum.toString().startsWith("4")) {
- randomNum = "A" + randomNum.toString().substring(1);
- }
- $("#iconIndex").val(randomNum);
- var border = "bili_" + randomNum + ".png";
- $("#icon-border").attr("style", "background-image: url(/dev/images/icon-border/" + border + ");");
- $("#icon-border")[0].onclick = exit;
- }
- function exit() {
- layui.data("95187", null);
- layui.data("35624", null);
- layui.data("13691", null);
- layui.data("05926", null);
- location.href = "/dev";
- }
|