fs-danaus
2024-09-18 13ec05cf0187ff67dc7cb8f03eae8c4b478f762a
Merge remote-tracking branch 'origin/dev' into dev
1个文件已修改
136 ■■■■ 已修改文件
WebRoot/js/loginValidate.js 136 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebRoot/js/loginValidate.js
@@ -8,30 +8,30 @@
     pubkey:"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAkRupiYcKVGGUtDBDoR1t/1zm3ZtZgnte39iTJW6hlqjdY0UagKjpNiIv7J6XjtgfX7SgsR4AWnivqQHAICIvdPKfGZZzIs62OQ19MqrDTMoB/LvK5teNWhClv23WMUfRbP+EHgprT6hTw8U5apw1IB6i/y57NkLav792wiYBYRU4X45NoTaT+aiTSLFEflbfm94EXnhSS3vFkBmrZGy5BRNI8gmzafroslGx2Hk90CqlNdeKYxgZQ6xtvj+u33yrszWvPT6F9fsJT8aMjtvH050iYKRVct+x6Q7VRJgCI4MgvAexnTKdxW54YzvXCuO5bDiy5la7CgerWkTAq9dzXwIDAQAB"
 };
 let telCoeKey;
(function($) {
    $.Read=function(){
(function($) {
    $.Read=function(){
        var _this=this;
        var select;
        var browserName = myexplorer();
        $(".get_phoneCode").addClass('is-disabled');
        $('.get_phoneCode').attr('disabled', true);
        if (browserName && browserName != "" && browserName != "谷歌") {
            $(".tips").show();
            $(".tips").show();
            alert("您正在使用 " + browserName +" 浏览器,强烈推荐您使用【谷歌】浏览器登录系统!");
        }else {
            $(".tips").hide();
            $(".tips").hide();
        }
        if(window.parent.length>0){
            window.parent.location=hostUrl+'/login.jsp';
        }
        if($("#snDiv").is(":visible")){
             $("#cltsn").focus();
             $("#cltsn").focus();
        } else{
             $("#name").focus();
             $("#name").focus();
        }
        //系统下拉选择
        this.setDate=function(event){
            if(event.selectedIndex!=-1){
@@ -48,14 +48,14 @@
                    });
                //设置有LOGO加载
                $('.login_logo img').attr('src','/getLogoIcon.do?dbid='+event.value);
             }
            select=event;
             }
            select=event;
        }
        this.reloadCode=function(i,event) {
        this.reloadCode=function(i,event) {
                 if(null!=event){
                     event.src="/imageCode?rand="+i;
                 }
                     event.src="/imageCode?rand="+i;
                 }
        }
        this.reloadTelCode=function (){
            $.get('/ws/captcha/get.do',function(r){
@@ -77,7 +77,7 @@
                return;
            }
        }
        this.disableButton=function(){
             $("#sub").attr("disabled",true);
             $("#sub").css("background-color","#bec4c8");
@@ -93,7 +93,7 @@
                     $("#cltsn").addClass("errorinput");
                }
                flg=true;
            }
            }
            if($("#name").val()=="" && isAccount){
                $(".name").find("span").html("请输入账号 / 手机号");
                 $("#name").addClass("errorinput");
@@ -120,13 +120,13 @@
                $("#phoneCode").addClass("errorinput");
                flg=true;
            }
            if(flg){
                removeDisableButton();
                return false;
            }
            if(!flg && ""==select.value && isonescore==""){
            if(!flg && ""==select.value && isonescore==""){
                $(".login_select").find("span").html("请选择一个系统");
                if(!$(".select").hasClass('l_select')){
                    $(".select").addClass('l_select');
@@ -149,16 +149,16 @@
            }else if($("#telephone").val()!="" && $("#phoneCode").val()!=""){
                //短信登录
                loginRequest("","",select.value);
            }
            }
        });
        $("#name").keydown(function(e){
            var e=e||window.event;
            if(e.keyCode==13){//回车键
                $("#pwd").focus();
            }
            }
        });
        $("#pwd").keydown(function(e){
            var e=e||window.event;
            if(e.keyCode==13){//回车键
@@ -167,34 +167,34 @@
                return;
            }
                $("#sub").click();
            }
            }
        });
        $("#code").keydown(function(e){
            var e=e||window.event;
            if(e.keyCode==13){//回车键
                $("#sub").click();
            }
            }
        });
        $("#reset").click(function(){
            $("#name").val("");
            $("#pwd").val("");
            $("#code").val("");
            $("#name").focus();
        });
        });
        // $("#ppwd").keyup(function() {
        //     $("#pwd").val(hex_md5($("#ppwd").attr("value")));
        //     $("#pwd").val(hex_md5($("#ppwd").attr("value")));
        // });
        // $(".sub_button").click(function(){
        //     _this.initValue();
        // });
        $("#randomming").click(function(){
            _this.reloadCode(Math.random(),this);
            _this.reloadCode(Math.random(),this);
        });
        $("#telimage").click(function(){
            // 获取验证码
@@ -231,18 +231,18 @@
        });
        $(".pop-sns-qq-m").on("touchend",function () {
            $(".icon-qq-m").removeClass("qq-hover");
        });
        });
        $("#dataName").change(function(){
            _this.setDate(this);
        });
        $("#dataName").click(function(){
            _this.setDate(this);
        });
        $("#dataName").triggerHandler('click');
        $("#randomming").triggerHandler('click');
        $(".pop-sns-weixin").click(function () {
            if(select.selectedIndex==-1){
                alert("必须选择一个账套");
@@ -262,11 +262,11 @@
                      }
                    });
        }catch(e){
        }
        }
            //location = oauth2HostName+"/oauth2/weixin.do?"+SessionKey+"="+select.value+"&orghost="+hostUrl;
        });
        $(".pop-sns-qq").click(function () {
            if(select.selectedIndex==-1){
                alert("必须选择一个账套");
@@ -290,14 +290,14 @@
        //
        // }
            //location =oauth2HostName+"/oauth2/qq.do?"+SessionKey+"="+select.value+"&orghost="+hostUrl;
        });
        });
        //maintaince.dbid=select.value;
    //    maintaince.isStop='false';
        //setInterval(maintaince.checkSysIsExpired, 10000);//10秒调用一次
        //checkSysIsExpired('<%=dbId%>','false');  //检查系统是否停止使用 Added by Johns Wang ,2017-05-26
        // 登录方式切换
        $(".nav_tab").on("click", function () {
            if(!$(this).hasClass('active')){
@@ -316,9 +316,9 @@
            if(!$(this).hasClass("active")){
                $(this).addClass("active");
                $('.login-password').hide();
                $('.qrcode-logins').show();
                $('.qrcode-logins').show();
                //获取二维码
                _this.createqrCode();
                _this.createqrCode();
            }else{
                if(webSocket!=null){
                    $(this).removeClass("active");
@@ -326,8 +326,8 @@
                    $('.qrcode-logins').hide();
                    webSocketClose();//关闭链接
                    webSocket=null;
                }
            }
                }
            }
        });
        // 获取验证码按钮
        var countTime = 60;  //倒计时时间
@@ -339,10 +339,10 @@
                return;
            }
            var phone=$("#telephone").val();
            if(!(/^1[3456789]\d{9}$/.test(phone))){
            if(!(/^1[3456789]\d{9}$/.test(phone))){
                $(".telephone").find("span").html("请输入正确的手机号码");
                $("#telephone").addClass("errorinput");
                return;
                return;
            }
          $(".get_phoneCode").addClass('is-disabled');
            $('.get_phoneCode').attr('disabled', true);
@@ -377,32 +377,36 @@
              }
          });
        });
       //二维码过期刷新
        $('.qrcode-error a').on('click',function(){
            //获取二维码
            _this.createqrCode();
            _this.createqrCode();
        });
        //生成二维码图片
        this.createqrCode=function(){
            $(".qrcode-error").hide();
            $(".qrcode-error").hide();
            $.post("/ws/qrCode.do?appId="+select.value,function(res){
                if(res!=null && res.code==0){
                    $(".qrcode-logins").find("img").attr("src",res.data.url);
                    initWebSocket(hostUrl+"/ws/qrLogin/"+select.value+"/"+res.data.qrcode+"/0",res.data.qrcode);
                }else{
                    alert(res.msg);
                    webSocket=-1;
                }
            },"json").error(function(e){
                if (res != null && res.code == 0) {
                    $(".qrcode-logins").find("img").attr("src", res.data.url);
                    initWebSocket(hostUrl + "/ws/qrLogin/" + select.value + "/" + res.data.qrcode + "/0", res.data.qrcode);
                } else {
                    if (res.data != null && res.data != '') {
                        alert(res.data);
                    } else {
                        alert(res.msg);
                    }
                    webSocket = -1;
                }
            },"json").error(function(e){
                webSocket=-1;
                alert(e.responseText);
                $(".qrcode-logins").find("img").attr("src","");
            });
            });
        }
    }
})(jQuery);
    }
})(jQuery);
//登录请求
function loginRequest(encryptUser,encryptPwd,dataName){
    $.ajax({
@@ -448,8 +452,8 @@
                    var url=$("#hostUrl").val()+"/home.jsp";
                    if(redirect!=""){
                        url+="?redirect="+redirect;
                    }
                    window.location.replace(url);
                    }
                    window.location.replace(url);
                }
            }
    },