更新于 07-05 20:48

This commit is contained in:
root
2021-07-05 20:48:46 -04:00
parent 25756cc34b
commit 69a8dc9325
7 changed files with 1585 additions and 0 deletions

136
panel/public/js/jd1.js Executable file
View File

@@ -0,0 +1,136 @@
var qrcode, userCookie, timeId;
$.ajaxSetup({
cache: false
});
$("#login").click(function () {
$user = $(".username").val();
$password = $(".password").val();
if (!$user || !$password) return;
$.post('./auth', {
username: $user,
password: $password
}, function (data) {
if (data.err == 0) {
window.location.href = "./usrconfig";
} else {
Swal.fire({
text: data.msg,
icon: 'error'
})
}
});
return false;
});
$(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(`./cookie2?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: msg || '🎈添加成功🎈',
/*
html:
'<div class="cookieCon" style="font-size:12px;">' +
userCookie +
'</div>',
text: userCookie,
*/
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) {
$('#qrcontainer').removeClass('hidden');
$('#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();
}
});

123
panel/public/js/jquery.base64.js Executable file
View File

@@ -0,0 +1,123 @@
/*!
* jquery.base64.js 0.0.3 - https://github.com/yckart/jquery.base64.js
* Makes Base64 en & -decoding simpler as it is.
*
* Based upon: https://gist.github.com/Yaffle/1284012
*
* Copyright (c) 2012 Yannick Albert (http://yckart.com)
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php).
* 2013/02/10
**/
;(function($) {
var b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",
a256 = '',
r64 = [256],
r256 = [256],
i = 0;
var UTF8 = {
/**
* Encode multi-byte Unicode string into utf-8 multiple single-byte characters
* (BMP / basic multilingual plane only)
*
* Chars in range U+0080 - U+07FF are encoded in 2 chars, U+0800 - U+FFFF in 3 chars
*
* @param {String} strUni Unicode string to be encoded as UTF-8
* @returns {String} encoded string
*/
encode: function(strUni) {
// use regular expressions & String.replace callback function for better efficiency
// than procedural approaches
var strUtf = strUni.replace(/[\u0080-\u07ff]/g, // U+0080 - U+07FF => 2 bytes 110yyyyy, 10zzzzzz
function(c) {
var cc = c.charCodeAt(0);
return String.fromCharCode(0xc0 | cc >> 6, 0x80 | cc & 0x3f);
})
.replace(/[\u0800-\uffff]/g, // U+0800 - U+FFFF => 3 bytes 1110xxxx, 10yyyyyy, 10zzzzzz
function(c) {
var cc = c.charCodeAt(0);
return String.fromCharCode(0xe0 | cc >> 12, 0x80 | cc >> 6 & 0x3F, 0x80 | cc & 0x3f);
});
return strUtf;
},
/**
* Decode utf-8 encoded string back into multi-byte Unicode characters
*
* @param {String} strUtf UTF-8 string to be decoded back to Unicode
* @returns {String} decoded string
*/
decode: function(strUtf) {
// note: decode 3-byte chars first as decoded 2-byte strings could appear to be 3-byte char!
var strUni = strUtf.replace(/[\u00e0-\u00ef][\u0080-\u00bf][\u0080-\u00bf]/g, // 3-byte chars
function(c) { // (note parentheses for precence)
var cc = ((c.charCodeAt(0) & 0x0f) << 12) | ((c.charCodeAt(1) & 0x3f) << 6) | (c.charCodeAt(2) & 0x3f);
return String.fromCharCode(cc);
})
.replace(/[\u00c0-\u00df][\u0080-\u00bf]/g, // 2-byte chars
function(c) { // (note parentheses for precence)
var cc = (c.charCodeAt(0) & 0x1f) << 6 | c.charCodeAt(1) & 0x3f;
return String.fromCharCode(cc);
});
return strUni;
}
};
while(i < 256) {
var c = String.fromCharCode(i);
a256 += c;
r256[i] = i;
r64[i] = b64.indexOf(c);
++i;
}
function code(s, discard, alpha, beta, w1, w2) {
s = String(s);
var buffer = 0,
i = 0,
length = s.length,
result = '',
bitsInBuffer = 0;
while(i < length) {
var c = s.charCodeAt(i);
c = c < 256 ? alpha[c] : -1;
buffer = (buffer << w1) + c;
bitsInBuffer += w1;
while(bitsInBuffer >= w2) {
bitsInBuffer -= w2;
var tmp = buffer >> bitsInBuffer;
result += beta.charAt(tmp);
buffer ^= tmp << bitsInBuffer;
}
++i;
}
if(!discard && bitsInBuffer > 0) result += beta.charAt(buffer << (w2 - bitsInBuffer));
return result;
}
var Plugin = $.base64 = function(dir, input, encode) {
return input ? Plugin[dir](input, encode) : dir ? null : this;
};
Plugin.btoa = Plugin.encode = function(plain, utf8encode) {
plain = Plugin.raw === false || Plugin.utf8encode || utf8encode ? UTF8.encode(plain) : plain;
plain = code(plain, false, r256, b64, 8, 6);
return plain + '===='.slice((plain.length % 4) || 4);
};
Plugin.atob = Plugin.decode = function(coded, utf8decode) {
coded = coded.replace(/[^A-Za-z0-9\+\/\=]/g, "");
coded = String(coded).split('=');
var i = coded.length;
do {--i;
coded[i] = code(coded[i], true, r64, a256, 6, 8);
} while (i > 0);
coded = coded.join('');
return Plugin.raw === false || Plugin.utf8decode || utf8decode ? UTF8.decode(coded) : coded;
};
}(jQuery));

51
panel/public/js/main.js Executable file
View File

@@ -0,0 +1,51 @@
/*
Spectral by HTML5 UP
html5up.net | @n33co
Free for personal and commercial use under the CCA 3.0 license (html5up.net/license)
*/
(function($) {
skel
.breakpoints({
xlarge: '(max-width: 1680px)',
large: '(max-width: 1280px)',
medium: '(max-width: 980px)',
small: '(max-width: 736px)',
xsmall: '(max-width: 480px)'
});
$(function() {
var $window = $(window),
$body = $('body'),
$wrapper = $('#page-wrapper'),
$banner = $('#banner'),
$header = $('#header');
// Disable animations/transitions until the page has loaded.
$body.addClass('is-loading');
$window.on('load', function() {
window.setTimeout(function() {
$body.removeClass('is-loading');
}, 100);
});
// Mobile?
if (skel.vars.mobile)
$body.addClass('is-mobile');
else
skel
.on('-medium !medium', function() {
$body.removeClass('is-mobile');
})
.on('+medium', function() {
$body.addClass('is-mobile');
});
});
})(jQuery);

2
panel/public/js/skel.min.js vendored Executable file

File diff suppressed because one or more lines are too long