-
Notifications
You must be signed in to change notification settings - Fork 4
/
decoder.js
36 lines (36 loc) · 973 Bytes
/
decoder.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
function enterdecode(e){
if (e.keyCode == 13){
try{
key = $("#key").val();
d=CryptoJS.AES.decrypt(data, key)
e=CryptoJS.enc.Latin1.stringify(d)
f=decodeURIComponent(escape(window.atob(e)))
console.log(f)
eval(f)
clearAndLoad();
$("#back_main").remove()
$("#class_select").remove()
$(".search_box").slideToggle()
}catch(err){
$("#key_input").css("background-color", "red")
$("#key").val('');
$("#key").attr("placeholder", "密钥不匹配 | 请重新输入")
}
}
}
function goGuest(){
clearAndLoad()
$("#search_input").remove()
$("#search_button").remove()
$("#add_data").remove()
$(".search_box").slideToggle()
}
//进入主页面和访客页面共同需要的操作
function clearAndLoad(){
loadJScript();
$("#key_input").remove();
$("#ctext").removeAttr("hidden")
$("#seeus").removeAttr("hidden")
$("#welcome_title").remove();
$("#copyright").remove();
}