PageSourceSearch

https://jwgl.suse.edu.cn/js/globalweb/login/login.js?ver=29830216

js suse.edu.cn collected 2026-10-04 01:07:28 UTC 31,012 bytes, 655 lines download raw bytes

1//给登录界面的action加上时间戳
2document.forms[0].action = (document.forms[0].action) + "?time=" + new Date().getTime();
3
4var dlArr = [];
5
6function refreshCode() {
7    $("#yzmPic").attr("src", _path + '/kaptcha?time=' + new Date().getTime());
8}
9
10function setLocal() {
11    var local = "zh_CN";
12    if ('1' == $("#sfzywqh").val()) {
13        local = $(".btn-lang-enabled").val();
14    }
15    return local;
16}
17
18function UserPolicy() {
19    $.showDialog(_path + '/xtgl/xwgl_ckYhxy.html', '用户协议', {})
20}
21
22function setUserInfo(data) {
23    var u = navigator.userAgent;
24    var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
25    if (isiOS) {
26        window.webkit.messageHandlers.sendUserInfo.postMessage(data);
27
28    } else {
29        window.android.sendUserInfo(data);
30
31    }
32}
33
34
35function getUserInfo(jsonStr) {
36    if (jsonStr != '') {
37        var yhxx = jsonStr.split(',');
38        window.location.href = _path + "/auth/auth_loginSuccess.html?yhm=" + yhxx[0] + "&timestamp=" + yhxx[1];
39    } else {
40        $("body").show();
41    }
42
43}
44
45jQuery(function ($) {
46    var sUserAgent = navigator.userAgent.toLowerCase();
47    if ($("#ydappsfbldlzt").val() == 1 && device.mobile() && sUserAgent.indexOf('zfsoft') > -1) {
48
49    } else {
50        $("body").show();
51    }
52    $(".refresh-text").off("click", "a[id='qrcode_refresh']").on("click", "a[id='qrcode_refresh']", function () {
53        $("#qrcode-content").hide();
54        $("#qcodediv").click();
55    });
56    $(".login-header").off("click", "div[id='qcodediv']").on("click", "div[id='qcodediv']", function () {
57        $("#home,#qcodediv").hide();
58        $("#qcodepc,#qcodcasepcdiv").show();
59        $.getJSON(_path + "/bysxxcx/xscjzbdy_getLoginQrCode.html", function (data) {
60            sfydl = true;
61            $("#qrcode-img img").attr("src", "data:image/png;base64," + data.img);
62            $("#uuid").val(data.UUID);
63        });
64
65        var erweimatime = 30;
66        //二维码刷新计时
67        var myVar = setInterval(myTimer, (erweimatime - 10) * 1000);
68        //切换到扫码登录后进行轮训,判断用户是否已经登录
69        var LoginTimer = setInterval(ztTimer, 5000);
70
71        function myTimer() {
72            $("#qrcode-content").show();
73            //二维码失效时停止计时器
74            clearInterval(myVar);
75            clearInterval(LoginTimer);
76        }
77
78        function ztTimer() {
79            if (!sfydl) {
80                //切换到用户登录页签时停止计时器
81                clearInterval(myVar);
82                clearInterval(LoginTimer);
83            } else {
84                $.ajax({
85                    url: _path + '/auth/auth_cxJwLoginZt.html',
86                    async: false,
87                    type: "post",
88                    data: {uuid: $("#uuid").val()},
89                    dataType: "json",
90                    success: function (data) {
91                        if (data.msg == 'success') {
92                            //返回登录状态为成功时停止计时器
93                            clearInterval(LoginTimer);
94                            window.location.href = _path + data.redirectPath;
95                        }
96                    }
97                });
98            }
99        }
100    });
101
102    $(".login-header").off("click", "div[id='qcodcasepcdiv']").on("click", "div[id='qcodcasepcdiv']", function () {
103        sfydl = false;
104        $("#home,#qcodediv").show();
105        $("#qcodepc,#qcodcasepcdiv").hide();
106    });
107
108    refreshCode();
109    $('#mm,#yzm').empty();
110
111    $("#mm").bind("copy paste cut", function () {
112        return $("#dlmmsfknt").val() == "1" ? true : false;
113    });
114
115    //获得焦点
116    $("#yhm").focus();
117    //设置回车登录事件
118    $('#yhm,#mm,#yzm').unbind("keydown").bind("keydown", function (e) {
119        var event = $.event.fix(e);
120        //回车自动查询
121        if (event.keyCode == 13) {
122            //取消浏览器默认行为
123            event.preventDefault();
124            //点击登录
125            $('#dl').click();
126        }
127        //取消事件冒泡
128        event.stopPropagation();
129        //阻止剩余的事件处理函数执行并且防止事件冒泡到DOM树上
130        event.stopImmediatePropagation();
131    });
132
133
134    var modulus, exponent;
135
136    $.getJSON(_path + "/xtgl/login_getPublicKey.html?time=" + new Date().getTime(), function (data) {
137        modulus = data["modulus"];
138        exponent = data["exponent"];
139    });
140
141    $("#dl").click(function () {
142        if ($("#userPolicyOn").val() == "1" && $("#agreePolicy").eq(0).is(':checked') == false) {
143            $("#tips").empty().append("请先阅读《用户协议》,并勾选已阅读。");
144            $("#tips").show();
145            return;
146        }
147        var loginBtn = this;
148        //2.让提交按钮失效,以实现防止按钮重复点击
149        $(loginBtn).attr('disabled', 'disabled');
150        //3.给用户提供友好状态提示
151        $(loginBtn).text('登录中...');
152        if ($(".btn-lang-enabled").val() == "en_US") {
153            $(loginBtn).text("Logining");
154        }
155        /*var time= sessionStorage.getItem('time');
156        var fz=Number($("#fz").val());
157        var ms=fz*60000;
158        var timestamp = (new Date()).valueOf(); //当前时间戳
159        if(time!=null&&time!=""){
160            if((parseInt(time)+parseInt(ms))>parseInt(timestamp)){
161                var sj=(parseInt(time)+parseInt(ms))-parseInt(timestamp);
162                var minutes = parseInt((sj % (1000 * 60 * 60)) / (1000 * 60)*60);
163                alert("您已超过最大登录失败次数,请在"+minutes+"秒后再登");
164                return;
165            }
166        }else{
167            var dlcount=$("#dlcount").val();
168            var yzcskz=$("#yzcskz").val();
169            var yh=$("#yh").val();
170            var dltime=$("#dltime").val();
171            if(dlcount>=yzcskz-1){
172                sessionStorage.setItem('user',yh);
173                sessionStorage.setItem('time',dltime);
174            }
175        }*/
176
177        var ts = '<span class="glyphicon glyphicon-minus-sign"></span>';
178        if (!$.founded($("#yhm").val())) {
179            $("#tips").empty().append(ts + $.i18n.zftal["login"]["user_empty"]);
180            $("#tips").show();
181            //5.让登陆按钮重新有效
182            $(loginBtn).removeAttr('disabled');
183            $(loginBtn).text('登录');
184            $("#mm").val("");
185            return false;
186        }
187        if (!$.founded($("#mm").val())) {
188            ///$("#tips").removeClass("alert-danger").addClass("alert-warning");
189            $("#tips").empty().append(ts + $.i18n.zftal["login"]["pwd_empty"]);
190            $("#tips").show();
191            //5.让登陆按钮重新有效
192            $(loginBtn).removeAttr('disabled');
193            $(loginBtn).text('登录');
194            $("#mm").val("");
195            return false;
196        }
197        if ($("#mmsrddcshkzfs").val() == "0") {
198            if ($("#yzmDiv:visible").size() > 0) {
199                if (!$.founded($("#yzm").val())) {
200                    $("#tips").empty().append(ts + $.i18n.zftal["login"]["yzm_empty"]);
201                    $("#tips").show();
202                    //5.让登陆按钮重新有效
203                    $(loginBtn).removeAttr('disabled');
204                    $(loginBtn).text('登录');
205                    $("#mm").val("");
206                    return false;
207                }
208            }
209        }
210
211        if ($("#mmsfjm").val() == '0') {
212            $("#hidMm").val($("#mm").val());
213        } else {
214            var rsaKey = new RSAKey();
215            rsaKey.setPublic(b64tohex(modulus), b64tohex(exponent));
216            var enPassword = hex2b64(rsaKey.encrypt($("#mm").val()));
217            $("#mm").val(enPassword);
218            $("#hidMm").val(enPassword);   //页面上放了一个隐藏的password类型输入框,name也是mm,防止密码自动填充,在提交的时候把内容设置成跟输入的密码一致
219
220        }
221		var sfxxqr = false;
222        $.ajax({
223            url: _path + '/xtgl/yhgl_cxXxqrCheck.html',
224            async: false,
225            type: "post",
226            dataType: "json",
227            data: {"yhm": $("#yhm").val()},
228            success: function (data) {
229				sfxxqr = data;
230            }
231        });
232        if (sfxxqr){
233            $.showDialog(_path + '/xtgl/yhgl_cxXxqrView.html', '身份信息', {
234                width: "500px",
235                modalName: "addModal",
236                data: {"yhm": $("#yhm").val()},
237                buttons: {
238                    success: {
239                        label: "确 定",
240                        className: "btn-primary",
241                        callback: function () {
242                            if ($("#syr_xxqr").val() == "") {
243                                $.alert("请填写使用人!");
244                                return false;
245                            }
246                            if ($("#syyy_xxqr").val() == "") {
247                                $.alert("请填写使用原因!");
248                                return false;
249                            }
250
251                            $.ajax({
252                                url: _path + '/xtgl/yhgl_cxXxqrBc.html',
253                                async: false,
254                                type: "post",
255                                dataType: "json",
256                                data: {"yhm": $("#yhm_xxqr").val(),"syr": $("#syr_xxqr").val(), "syyy": $("#syyy_xxqr").val()},
257                                success: function (msg) {
258                                    $.closeModal("addModal");
259                                    if ($("#mmsrddcshkzfs").val() == "1") {
260                                        var isSuccess = false;
261                                        $.ajax({
262                                            url: _path + '/xtgl/login_cxDlxgxx.html',
263                                            async: false,
264                                            type: "post",
265                                            dataType: "json",
266                                            data: {"yhm": $("#yhm").val()},
267                                            success: function (data) {
268                                                if (data == "0") {
269                                                    //alert("用户不存在");
270                                                    if ($(".btn-lang-enabled").val() == "en_US") {
271                                                        $("#tips").empty().append(ts + "User does not exist");
272                                                        $("#tips").show();
273                                                    } else {
274                                                        $("#tips").empty().append(ts + "用户不存在");
275                                                        $("#tips").show();
276                                                    }
277                                                    isSuccess = false;
278                                                } else {
279                                                    var dataArr = data.split("_");
280                                                    var yzcskz = $("#yzcskz").val();
281                                                    if (dataArr[0] >= yzcskz) {
282                                                        var fz = Number($("#dlsbsdsj").val());//设置的锁定时间(分钟)
283                                                        var ms = fz * 60000;//转成秒数
284                                                        var timestamp = (new Date()).valueOf(); //当前时间戳
285                                                        if ((parseInt(dataArr[1]) + parseInt(ms)) > parseInt(timestamp)) {
286                                                            var sj = (parseInt(dataArr[1]) + parseInt(ms)) - parseInt(timestamp);
287                                                            var minutes = parseInt((sj % (1000 * 60 * 60)) / (1000 * 60) * 60);
288                                                            if ($(".btn-lang-enabled").val() == "en_US") {
289                                                                $("#tips").empty().append(ts + "You have exceeded the maximum number of login failures. Please sign in after " + minutes + " seconds");
290                                                                $("#tips").show();
291                                                            } else {
292                                                                $("#tips").empty().append(ts + "您已超过最大登录失败次数,请在" + minutes + "秒后再登");
293                                                                $("#tips").show();
294                                                            }
295                                                            //alert("您已超过最大登录失败次数,请在"+minutes+"秒后再登");
296                                                            isSuccess = false;
297                                                        } else {
298                                                            //锁定时间过了就更新登录失败次数为0
299                                                            $.ajax({
300                                                                url: _path + '/xtgl/login_cxUpdateDlsbcs.html',
301                                                                async: false,
302                                                                type: "post",
303                                                                dataType: "json",
304                                                                data: {"yhm": $("#yhm").val()},
305                                                                success: function (data) {
306                                                                    if (data == "操作成功") {
307                                                                        isSuccess = true;
308                                                                    }
309                                                                }
310                                                            })
311                                                        }
312                                                    } else {
313                                                        isSuccess = true;
314                                                    }
315                                                }
316                                            }
317                                        });
318                                        if (isSuccess) {
319                                            yhdl();
320                                        }
321                                        else {
322                                            //5.让登陆按钮重新有效
323                                            $(loginBtn).removeAttr('disabled');
324                                            $(loginBtn).text('登录');
325                                            $("#mm").val("");
326                                            return false;
327                                        }
328                                    }
329                                    else {
330                                        yhdl();
331                                    }
332                                }
333                            })
334                            return false;
335                        }
336                    },
337                    cancel: {
338                        label: "关 闭",
339                        className: "btn-default",
340                        callback: function () {
341                            window.location.href = window.location.href;
342                        }
343
344                    }
345                }
346            });
347        }else{
348            //		var isSuccess = false;
349            //		$.ajax({
350            //			url		:_path+'/xtgl/login_cxCheckYh.html',
351            //			async	: false,
352            //			type	:"post",
353            //			dataType:"json",
354            //			data	:{"yhm":$("#yhm").val(), "mm":$("#mm").val(), "yzm" :$("#yzm").val()},
355            //			success	:function(data){
356            //				if(data["status"]=="success"){
357            //					isSuccess = true;
358            //				}else{
359            //					//输错三次 则需输验证码
360            //					if((data["dlCount"]||0) * 1 >= 3){
361            //						$("#yzmDiv").show();
362            //						refreshCode();
363            //					}
364            //					refreshCode();
365            //					//提示
366            //					$("#tips").empty().append(ts + data["message"]);
367            //					$("#tips").show();
368            //					isSuccess = false;
369            //				}
370            //			}
371            //		});
372            //		if(isSuccess){
373            //document.forms[0].submit();
374            //		}else{
375            //			return false;
376            //		}
377            if ($("#mmsrddcshkzfs").val() == "1") {
378                var isSuccess = false;
379                $.ajax({
380                    url: _path + '/xtgl/login_cxDlxgxx.html',
381                    async: false,
382                    type: "post",
383                    dataType: "json",
384                    data: {"yhm": $("#yhm").val()},
385                    success: function (data) {
386                        if (data == "0") {
387                            //alert("用户不存在");
388                            if ($(".btn-lang-enabled").val() == "en_US") {
389                                $("#tips").empty().append(ts + "User does not exist");
390                                $("#tips").show();
391                            } else {
392                                $("#tips").empty().append(ts + "用户不存在");
393                                $("#tips").show();
394                            }
395                            isSuccess = false;
396                        } else {
397                            var dataArr = data.split("_");
398                            var yzcskz = $("#yzcskz").val();
399                            if (dataArr[0] >= yzcskz) {
400                                var fz = Number($("#dlsbsdsj").val());//设置的锁定时间(分钟)
401                                var ms = fz * 60000;//转成秒数
402                                var timestamp = (new Date()).valueOf(); //当前时间戳
403                                if ((parseInt(dataArr[1]) + parseInt(ms)) > parseInt(timestamp)) {
404                                    var sj = (parseInt(dataArr[1]) + parseInt(ms)) - parseInt(timestamp);
405                                    var minutes = parseInt((sj % (1000 * 60 * 60)) / (1000 * 60) * 60);
406                                    if ($(".btn-lang-enabled").val() == "en_US") {
407                                        $("#tips").empty().append(ts + "You have exceeded the maximum number of login failures. Please sign in after " + minutes + " seconds");
408                                        $("#tips").show();
409                                    } else {
410                                        $("#tips").empty().append(ts + "您已超过最大登录失败次数,请在" + minutes + "秒后再登");
411                                        $("#tips").show();
412                                    }
413                                    //alert("您已超过最大登录失败次数,请在"+minutes+"秒后再登");
414                                    isSuccess = false;
415                                } else {
416                                    //锁定时间过了就更新登录失败次数为0
417                                    $.ajax({
418                                        url: _path + '/xtgl/login_cxUpdateDlsbcs.html',
419                                        async: false,
420                                        type: "post",
421                                        dataType: "json",
422                                        data: {"yhm": $("#yhm").val()},
423                                        success: function (data) {
424                                            if (data == "操作成功") {
425                                                isSuccess = true;
426                                            }
427                                        }
428                                    })
429                                }
430                            } else {
431                                isSuccess = true;
432                            }
433                        }
434                    }
435                });
436
437                if (isSuccess) {
438                    yhdl();
439                    //登录前退出原先的帐号
440//					$.post(_path + "/xtgl/login_logoutAccount.html",{"csrfTokenLogout":$("#csrfTokenLogout").val()},function(){
441//						var local = setLocal();
442//						$("#language").val(local);
443//						document.forms[0].submit();
444//					});
445                } else {
446                    //5.让登陆按钮重新有效
447                    $(loginBtn).removeAttr('disabled');
448                    $(loginBtn).text('登录');
449                    $("#mm").val("");
450                    return false;
451                }
452            } else {
453                yhdl();
454                //登录前退出原先的帐号
455//				$.post(_path + "/xtgl/login_logoutAccount.html",{"csrfTokenLogout":$("#csrfTokenLogout").val()},function(){
456//					var local = setLocal();
457//					$("#language").val(local);
458//					document.forms[0].submit();
459//				});
460            }
461        }
462
463    });
464
465    function yhdl() {
466        //登录前退出原先的帐号
467        $.post(_path + "/xtgl/login_logoutAccount.html", {"csrfTokenLogout": $("#csrfTokenLogout").val()}, function () {
468            var local = setLocal();
469            $("#language").val(local);
470            //判断是否需要短信验证
471            if ($("#dxsyrz").val() == '1') {
472                //判断是否存在手机号
473                $.post(_path + "/xtgl/login_dxyzCxsjhm.html", {"yhm": $("#yhm").val()}, function (data) {
474                    if (data == "1") {//判断是否存在手机号
475                        $.showDialog(_path + "/xtgl/login_dxyzIndex.html?gnmkdm=login&yhm=" + $("#yhm").val(), '短信验证', $.extend(true, {}, addConfig, {
476                                width: "600px",
477                                modalName: "rqyzmModal",
478                                buttons: {
479                                    success: {
480                                        label: "确定",
481                                        className: "btn-primary",
482                                        callback: function () {
483                                            if ($("#dlyzm").val() == "") {
484                                                $.alert("请填写验证码!");
485                                                return false;
486                                            }
487
488                                            $.ajax({
489                                                url: _path + '/xtgl/login_dxyzQryzm.html',
490                                                async: false,
491                                                type: "post",
492                                                dataType: "json",
493                                                data: {"sjhm": $("#sjhm").val(), "yzm": $("#dlyzm").val()},
494                                                success: function (msg) {
495                                                    if (msg == "1") {
496                                                        $.closeModal("rqyzmModal");
497                                                        document.forms[0].submit();
498                                                    } else {
499                                                        $.alert("验证失败", function () {
500                                                            //window.location.href = window.location.href;
501                                                        });
502                                                    }
503                                                }
504                                            })
505                                            return false;
506                                        }
507                                    },
508                                    cancel: {
509                                        label: "关 闭",
510                                        className: "btn-default",
511                                        callback: function () {
512                                            window.location.href = window.location.href;
513                                        }
514                                    }
515                                }
516                            }
517                        ));
518                        return false;
519                    } else {
520                        $.error("当前用户未预留手机号,无法登录系统!");
521                        window.location.href = window.location.href;
522                    }
523                });
524            } else {
525                if ($("#ydappsfbldlzt").val() == 1 && device.mobile() && sUserAgent.indexOf('zfsoft') > -1) {
526                    $.post(_path + "/auth/auth_yhmMm.html", {"yhm": jQuery("#yhm").val()}, function (data) {
527                        setUserInfo(data);
528                    });
529                    document.forms[0].submit();
530                } else {
531                    document.forms[0].submit();
532                }
533            }
534        });
535    }
536
537    $("#dxyzmdl").click(function () {
538        //登录前退出原先的帐号
539        $.post(_path + "/xtgl/login_logoutAccount.html", {"csrfTokenLogout": $("#csrfTokenLogout").val()}, function () {
540            var local = setLocal();
541            $("#language").val(local);
542
543            $.showDialog(_path + "/xtgl/login_dxyzmdlIndex.html?gnmkdm=login", '短信验证码登录', $.extend(true, {}, addConfig, {
544                    width: "600px",
545                    modalName: "dxyzmModal",
546                    buttons: {
547                        success: {
548                            label: "确定",
549                            className: "btn-primary",
550                            callback: function () {
551                                if ($("#sjhm").val() == "") {
552                                    $.alert("请填写手机号码!");
553                                    return false;
554                                }
555
556                                if ($("#dlyzm").val() == "") {
557                                    $.alert("请填写验证码!");
558                                    return false;
559                                }
560
561                                $.ajax({
562                                    url: _path + '/xtgl/login_dxyzmdlQryzm.html',
563                                    async: false,
564                                    type: "post",
565                                    dataType: "json",
566                                    data: {"sjhm": $("#sjhm").val(), "yzm": $("#dlyzm").val()},
567                                    success: function (msg) {
568                                        if (msg.indexOf("success") != -1) {
569                                            $.closeModal("dxyzmModal");
570                                            //window.location.href = _path + "/xtgl/index_initMenu.html";
571                                            window.location.href = _path + msg.split("-")[1];
572                                        } else {
573                                            $.alert("验证失败", function () {
574                                                //window.location.href = window.location.href;
575                                            });
576                                        }
577                                    }
578                                })
579                                return false;
580                            }
581                        },
582                        cancel: {
583                            label: "关 闭",
584                            className: "btn-default",
585                            callback: function () {
586                                window.location.href = window.location.href;
587                            }
588                        }
589                    }
590                }
591            ));
592            return false;
593        });
594    });
595
596    /*//pwStrength函数   用于验证
597    //当用户放开键盘或密码输入框失去焦点时,根据不同的级别显示提示
598    function passStrength(password) {
599        var jqYhmmdj=jQuery("#yhmmdj");
600        if (password == null || password == '') {
601            hideErrMsg();
602        } else {
603            var S_level = checkStrong(password);
604            //设置密码强度
605            jqYhmmdj.val(S_level);
606            switch (S_level) {
607            case 0:
608                showErrMsg("密码太短,请及时修改!");
609                strong = false;
610                return false;
611            case 1:
612                showErrMsg("密码强度太弱,请及时修改!");
613                strong = false;
614                return false;
615            default:
616                strong = true;
617                hideErrMsg();
618            }
619        }
620
621        //验证用户名是否相同
622        if(!checkYhmAndMm()){
623            //设置密码强度 ,定死设定弱密码
624            jqYhmmdj.val("1");
625        }
626    }*/
627    /*	//保存Cookie
628        function SetCookie(){
629            var username = jQuery("#yhm").val();
630            var Then 	 = new Date();
631            Then.setTime(Then.getTime() + 1866240000000);
632            document.cookie ="yhm="+username+"%%;expires="+ Then.toGMTString() ;
633        }*/
634    /*	//读取Cookie
635        function GetCookie(){
636            var nmpsd;
637            var nm;
638            var cookieString = new String(document.cookie);
639            var cookieHeader = "yhm=";
640            var beginPosition = cookieString.indexOf(cookieHeader);
641            cookieString = cookieString.substring(beginPosition);
642            var ends=cookieString.indexOf(";");
643            if (ends!=-1){
644               cookieString = cookieString.substring(0,ends);
645            }
646            if (beginPosition>-1){
647               nmpsd = cookieString.substring(cookieHeader.length);
648               if (nmpsd!=""){
649                beginPosition = nmpsd.indexOf("%%");
650                nm=nmpsd.substring(0,beginPosition);
651                document.getElementById("yhm").value=nm;
652               }
653            }
654        }*/
655});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.