3 lines
3.8 KiB
JavaScript
3 lines
3.8 KiB
JavaScript
|
$("body").on("keypress",function(o){o.keyCode==13&&zesol()}),$(".logsbtn").on("click",function(){zesol()});function zesol(){var o=$(".accounts .istetxt").val(),c=$(".passwords .istetxt").val();o||c||o||c?$.ajax({type:"POST",headers:{token:getCookie("token")},url:"/api/jwt/getUserSchoolForLogin",contentType:"application/json",dataType:"json",data:JSON.stringify({username:o,password:encrypt(c,"njsdearr8h239ay3"),encrypted:!0}),async:!0,success:function(l){if(l.data.length<=0)layer.alert("\u8F93\u5165\u7684\u8D26\u53F7\u5BC6\u7801\u6709\u8BEF\uFF01");else if(l.code==200){$(".gintan").show(),$("#gin").hide(),$(document).attr("title","\u9009\u62E9\u7F51\u6821");for(var r=l.data,e="",t=JSON.stringify({a:o,p:c}),a=new Base64,i=a.encode(t),s=0,g=r.length;s<g;s++){var n=r[s],f=n.secondLevelDomain,h=n.topLevelDomain,d=getMyDate(n.createTimeStamp);e+="<li>",n.isHttps==1?f==""?e+='<a class="home" href="https://'+h+"/pages/loginChild.html?"+i+'" >':e+='<a class="home" href="https://'+f+"/pages/loginChild.html?"+i+'" >':f==""?e+='<a class="home" href="http://'+h+"/pages/loginChild.html?"+i+'" >':e+='<a class="home" href="http://'+f+"/pages/loginChild.html?"+i+'" >',e+='<span class="logimg"><img src="'+n.logo+'"></span>',n.cover?e+='<img src="'+n.cover+'">':e+='<img src="/static/front/images/node.png">',e+='<span class="title">'+n.schoolName+"</span>",e+='<span class="introduce">'+n.introduce+"</span>",e+='<span class="tise">'+d+"",n.headPortrait?e+='<img class="spimg" src="'+n.headPortrait+'">':e+='<img class="spimg" src="/static/common/image/logo/1.jpg">',e+="</span>",e+="</a>",e+="</li>"}r.length==0?$(".xtwlb").html("<span style='text-align:center;width:100%;text-indent:0;font-size:16px;'>\u8BE5\u8D26\u53F7\u6682\u65E0\u7F51\u6821\uFF0C\u8BF7\u5237\u65B0\u7F51\u9875\u91CD\u65B0\u767B\u5F55\uFF01</span>"):$(".xtwlb").html(e)}else alert("\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458")}}):layer.alert("\u8D26\u53F7\u6216\u5BC6\u7801\u4E0D\u80FD\u4E3A\u7A7A\uFF01")}function Base64(){var o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";this.encode=function(r){var e="",t,a,i,s,g,n,f,h=0;for(r=c(r);h<r.length;)t=r.charCodeAt(h++),a=r.charCodeAt(h++),i=r.charCodeAt(h++),s=t>>2,g=(t&3)<<4|a>>4,n=(a&15)<<2|i>>6,f=i&63,isNaN(a)?n=f=64:isNaN(i)&&(f=64),e=e+o.charAt(s)+o.charAt(g)+o.charAt(n)+o.charAt(f);return e},this.decode=function(r){var e="",t,a,i,s,g,n,f,h=0;for(r=r.replace(/[^A-Za-z0-9\+\/\=]/g,"");h<r.length;)s=o.indexOf(r.charAt(h++)),g=o.indexOf(r.charAt(h++)),n=o.indexOf(r.charAt(h++)),f=o.indexOf(r.charAt(h++)),t=s<<2|g>>4,a=(g&15)<<4|n>>2,i=(n&3)<<6|f,e=e+String.fromCharCode(t),n!=64&&(e=e+String.fromCharCode(a)),f!=64&&(e=e+String.fromCharCode(i));return e=l(e),e};var c=function(r){r=r.replace(/\r\n/g,`
|
||
|
`);for(var e="",t=0;t<r.length;t++){var a=r.charCodeAt(t);a<128?e+=String.fromCharCode(a):a>127&&a<2048?(e+=String.fromCharCode(a>>6|192),e+=String.fromCharCode(a&63|128)):(e+=String.fromCharCode(a>>12|224),e+=String.fromCharCode(a>>6&63|128),e+=String.fromCharCode(a&63|128))}return e},l=function(r){for(var e="",t=0,a=0,i=0,s=0,g=0;t<r.length;)a=r.charCodeAt(t),a<128?(e+=String.fromCharCode(a),t++):a>191&&a<224?(s=r.charCodeAt(t+1),e+=String.fromCharCode((a&31)<<6|s&63),t+=2):(s=r.charCodeAt(t+1),g=r.charCodeAt(t+2),e+=String.fromCharCode((a&15)<<12|(s&63)<<6|g&63),t+=3);return e}}function A(){$(document).attr("title","\u7528\u6237\u767B\u5F55")}$(function(){setTimeout("A()",500)}),$(".forgetPossword span").on("click",function(){user.getPasswordLayer(function(o){})});function getMyDate(o){var c=new Date(o),l=c.getFullYear(),r=c.getMonth()+1,e=c.getDate(),t=c.getHours(),a=c.getMinutes(),i=c.getSeconds(),s=l+"-"+getzf(r)+"-"+getzf(e);return s}function getzf(o){return parseInt(o)<10&&(o="0"+o),o}function getCookie(o){for(var c=document.cookie,l=c.split("; "),r=0;r<l.length;r++){var e=l[r].split("=");if(e[0]==o)return e[1]}return""}
|