diff --git a/panel/public/index.html b/panel/public/index.html index fedc278..30b81a6 100755 --- a/panel/public/index.html +++ b/panel/public/index.html @@ -65,7 +65,113 @@
- + \ No newline at end of file diff --git a/panel/public/js/jd1.js b/panel/public/js/jd1.js deleted file mode 100755 index e44deee..0000000 --- a/panel/public/js/jd1.js +++ /dev/null @@ -1,107 +0,0 @@ -var qrcode, userCookie, timeId; - -$(document).ready(function () { - qrcode = new QRCode(document.getElementById('qrcode'), { - text: 'sample', - correctLevel: QRCode.CorrectLevel.L, - }); - - function checkLogin(user) { - var timeId = setInterval(() => { - let timeStamp = new Date().getTime(); - var msg = $('#ps').val(); - console.log(user); - $.post(`./cookie?t=${timeStamp}`, { user, msg }, function (data) { - if (data.err == 0) { - clearInterval(timeId); - $('#qrcontainer').addClass('hidden'); - $('#refresh_qrcode').addClass('hidden'); - userCookie = data.cookie; - msg = data.msg; - Swal.fire({ - title: '🎈添加成功🎈', - html: - '
' + - `您的账号已经成功添加,时长为一个月` + - '
', - icon: 'success', - confirmButtonText: '返回', - }).then((result) => { - do_landing(); - }); - } else if (data.err == 21) { - clearInterval(timeId); - $('#refresh_qrcode').removeClass('hidden'); - } - }); - }, 3000); - } - - function GetQrCode() { - let timeStamp = new Date().getTime(); - $.get('./qrcode?t=' + timeStamp, function (data) { - if (data.err == 0) { - $('#qrcontainer').removeClass('hidden'); - $('#refresh_qrcode').addClass('hidden'); - $('.landing').addClass('is-loading'); - qrcode.clear(); - qrcode.makeCode(data.qrcode); - checkLogin(data.user); - } else { - Swal.fire({ - text: data.msg, - icon: 'error', - }); - } - }); - } - - function JumpToApp() { - let timeStamp = new Date().getTime(); - $.get('./qrcode?t=' + timeStamp, function (data) { - if (data.err == 0) { - $('#refresh_qrcode').addClass('hidden'); - $('.landing').addClass('is-loading'); - window.location.href = `openapp.jdmobile://virtual/ad?params=${encodeURI( - JSON.stringify({ - category: 'jump', - des: 'ThirdPartyLogin', - action: 'to', - onekeylogin: 'return', - url: data.qrcode, - authlogin_returnurl: 'weixin://', - browserlogin_fromurl: window.location.host, - }) - )}`; - checkLogin(data.user); - } else { - Swal.fire({ - text: data.msg, - icon: 'error', - }); - } - }); - } - - $('.refresh').click(GetQrCode); - $('#GetQrCode').click(GetQrCode); - $('#JumpToApp').click(JumpToApp); - - $('.qframe-close').click(function () { - qframe_close(); - }); - - function do_landing() { - window.setTimeout(function () { - $('.landing').removeClass('is-loading'); - }, 100); - } - - function qframe_close() { - $("#qrcontainer").addClass("hidden"); - $("#refresh_qrcode").addClass("hidden"); - //window.location.reload(); - clearInterval(timeId); - do_landing(); - } -}); \ No newline at end of file