From fc69ebdafb2ecc30ca8f0fbd24b1fb220a1c7545 Mon Sep 17 00:00:00 2001 From: cebgcontract <99630598+cebgcontract@users.noreply.github.com> Date: Thu, 17 Nov 2022 01:24:26 +0800 Subject: [PATCH 1/3] remove unused code of index --- public/mobile.html | 92 ++++------------------------------------------ 1 file changed, 8 insertions(+), 84 deletions(-) diff --git a/public/mobile.html b/public/mobile.html index 578c1e3..5d82046 100755 --- a/public/mobile.html +++ b/public/mobile.html @@ -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(); From 2b9cee32f6c29ff46dd274c356e12908b842cf84 Mon Sep 17 00:00:00 2001 From: cebgcontract <99630598+cebgcontract@users.noreply.github.com> Date: Thu, 17 Nov 2022 01:25:14 +0800 Subject: [PATCH 2/3] merge --- public/mobile.html | 8 +++++--- src/views/layout/Header.vue | 6 ++++++ src/views/mobile/Recommend.vue | 4 ++-- src/views/mobile/Success.vue | 1 + 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/public/mobile.html b/public/mobile.html index 5d82046..42b1cbe 100755 --- a/public/mobile.html +++ b/public/mobile.html @@ -476,9 +476,11 @@ $("#wallet_login_btn").click(function () { location.href = "/login"; }); - $("#logout_btn").click(function () { - localStorage.removeItem("userinfo"); - }); + $('#logout_btn').click(function(){ + localStorage.removeItem('userinfo') + localStorage.removeItem('invite_code'); + location.reload() + }) }); $(".anmode").each(function () { diff --git a/src/views/layout/Header.vue b/src/views/layout/Header.vue index 85a5c6e..9d134c7 100644 --- a/src/views/layout/Header.vue +++ b/src/views/layout/Header.vue @@ -35,8 +35,14 @@ export default { }, logout() { chain.logout(); +<<<<<<< HEAD localStorage.removeItem("userinfo"); location.href = "/desktop.html"; +======= + localStorage.removeItem('userinfo'); + localStorage.removeItem('invite_code'); + location.href = '/desktop.html' +>>>>>>> 0894597 (change sth) }, toQuest(e) { this.$router.push("rankinglist"); diff --git a/src/views/mobile/Recommend.vue b/src/views/mobile/Recommend.vue index 3bbb2c5..f473bd3 100644 --- a/src/views/mobile/Recommend.vue +++ b/src/views/mobile/Recommend.vue @@ -13,7 +13,7 @@