remove unused code of index
This commit is contained in:
parent
d6b99c4f91
commit
fc69ebdafb
@ -464,7 +464,7 @@
|
||||
$("#logined_btn").html(formatAddress(address));
|
||||
$("#wallet_login_btn").hide();
|
||||
$("#logined_btn").show();
|
||||
$("#page_login_btn").attr("href", "/sinup");
|
||||
$("#page_login_btn").attr("href", "/signup");
|
||||
checkActivity(address, function () {});
|
||||
}
|
||||
return true;
|
||||
@ -473,8 +473,8 @@
|
||||
}
|
||||
};
|
||||
checkLogin();
|
||||
$("#wallet_login_btn").click(function () {
|
||||
location.href = "/sinup";
|
||||
$("#wallet_login_btn").click(function () {
|
||||
location.href = "/login";
|
||||
});
|
||||
$("#logout_btn").click(function () {
|
||||
localStorage.removeItem("userinfo");
|
||||
@ -498,88 +498,12 @@
|
||||
if (!th.hasClass("animated")) {
|
||||
th.addClass("animated");
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
$(function () {
|
||||
$(".rule_sliders").click(function () {
|
||||
if (!$(this).hasClass("sliderOn")) {
|
||||
$(".rule_sliders").removeClass("sliderOn");
|
||||
$(this).addClass("sliderOn");
|
||||
$(".rule_descprition").slideUp();
|
||||
$(this).find(".rule_descprition").slideDown();
|
||||
} else {
|
||||
$(this).removeClass("sliderOn");
|
||||
$(this).find(".rule_descprition").slideUp();
|
||||
}
|
||||
});
|
||||
var address = "";
|
||||
var token = "";
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
var checkActivity = function (address, cb) {
|
||||
var settings = {
|
||||
url: "http://192.168.100.83:3000/aa1/user_status",
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
data: JSON.stringify({
|
||||
account: address,
|
||||
}),
|
||||
};
|
||||
|
||||
$.ajax(settings).done(function (res) {
|
||||
if (!res.errcode) {
|
||||
if (res.status == 4) {
|
||||
$("#page_login_btn").hide();
|
||||
$("#page_quest_btn").show();
|
||||
} else if (res.status == 1) {
|
||||
$("#page_login_btn").show();
|
||||
$("#page_quest_btn").hide();
|
||||
$("#page_login_btn").attr("href", "/recommend");
|
||||
} else {
|
||||
$("#page_login_btn").show();
|
||||
$("#page_quest_btn").hide();
|
||||
$("#page_login_btn").attr("href", "/login");
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
var checkLogin = function () {
|
||||
let userinfo = window.localStorage.getItem("userinfo");
|
||||
if (!userinfo) {
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
let udata = JSON.parse(userinfo);
|
||||
console.log(udata);
|
||||
address = udata.account;
|
||||
token = udata.token;
|
||||
if (address) {
|
||||
$("#logined_btn").html(formatAddress(address));
|
||||
$("#wallet_login_btn").hide();
|
||||
$("#logined_btn").show();
|
||||
$("#page_login_btn").attr("href", "/signup");
|
||||
checkActivity(address, function () {});
|
||||
}
|
||||
return true;
|
||||
} catch (err) {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
checkLogin();
|
||||
$("#wallet_login_btn").click(function () {
|
||||
location.href = "/sinup";
|
||||
});
|
||||
});
|
||||
|
||||
$(".anmode").each(function () {
|
||||
var th = $(this);
|
||||
var dura = th.data("dura");
|
||||
var delay = th.data("delay");
|
||||
th.css("animation-duration", dura);
|
||||
th.css("animation-delay", delay);
|
||||
});
|
||||
|
||||
|
||||
$(window).scroll(function () {
|
||||
var windowtop = $(window).scrollTop();
|
||||
|
Loading…
x
Reference in New Issue
Block a user