鱼C论坛

 找回密码
 立即注册
查看: 3828|回复: 8

[技术交流] 校园网里下载来的两个js文件,破译一下,有木有啥漏洞,交流交流。

[复制链接]
发表于 2020-8-31 20:13:25 | 显示全部楼层 |阅读模式
50鱼币
这是第一个代码文件:
  1. (function(window, undefined) {
  2.         var rquickExpr = /^#([\w-]*)$/;
  3.         var jQuery = function(selector) {
  4.                 return new jQuery.fn.init(selector);
  5.         };
  6.         jQuery.fn = jQuery.prototype = {
  7.                 constructor:jQuery,
  8.                 length: 0,
  9.                 size: function() {
  10.                         return this.length;
  11.                 },
  12.                 init:function(selector) {
  13.                         if (typeof selector === "string") {
  14.                                 match = rquickExpr.exec(selector);
  15.                                 if(match&&match[1]){
  16.                                         elem = document.getElementById(match[1]);
  17.                                         if (elem && elem.parentNode) {
  18.                                                 if (elem.id !== match[1]) {
  19.                                                         jQuery.error("语法错误,元素id和参数不一致!")
  20.                                                 }
  21.                                                 this.length = 1;
  22.                                                 this[0] = elem;
  23.                                         }

  24.                                         this.context = document;
  25.                                         this.selector = selector;
  26.                                         return this;
  27.                                 }else{
  28.                                         jQuery.error(selector+"语法错误,暂时支持id的获取!")
  29.                                 }
  30.                                
  31.                         } else if (selector.nodeType) {
  32.                                 this.context = this[0] = selector;
  33.                                 this.length = 1;
  34.                                 return this;
  35.                         } else {
  36.                                 this.context = this[0] = selector;
  37.                                 this.length = 1;
  38.                                 return this;
  39.                         }
  40.                 }
  41.         };
  42.         jQuery.fn.init.prototype = jQuery.fn;
  43.         jQuery.extend = jQuery.fn.extend = function() {
  44.                 var target = this;
  45.                 var length = arguments.length;
  46.                 var i = 0;
  47.                 if (length > 1) {
  48.                         target = arguments[0] || {};
  49.                         i = 1;
  50.                 }

  51.                 for (; i < length; i++) {
  52.                         if ((options = arguments[i]) != null) {
  53.                                 for (name in options) {
  54.                                         src = target[name];
  55.                                         copy = options[name];
  56.                                         if (target === copy) {
  57.                                                 continue;
  58.                                         }
  59.                                         target[name] = copy;
  60.                                 }
  61.                         }
  62.                 }
  63.                 return target;
  64.         };
  65.         var rclass = /[\t\r\n]/g;
  66.         jQuery.fn.extend({
  67.                 html:function(value) {
  68.                         var elem = this[0];
  69.                         if(!elem){
  70.                                 return;
  71.                         }
  72.                         if (value === undefined) {
  73.                                 return jQuery.trim(elem.nodeType === 1 ? elem.innerHTML:"");
  74.                         } else {
  75.                                 if (elem.nodeType === 1) {
  76.                                         elem.innerHTML = value;
  77.                                 }
  78.                         }
  79.                 },
  80.                 width:function(){
  81.                         var elem=this[0];
  82.                         if(!elem){
  83.                                 return 0;
  84.                         }
  85.                         if ( jQuery.isWindow( elem ) ) {
  86.                                 return parseInt(elem.document.documentElement[ "offsetWidth" ]);
  87.                         }
  88.                         return parseInt(this.css("width"));
  89.                 },
  90.                 height:function(){
  91.                         var elem=this[0];
  92.                         if(!elem){
  93.                                 return 0;
  94.                         }
  95.                         if ( jQuery.isWindow( elem ) ) {
  96.                                 return parseInt(elem.document.documentElement[ "offsetHeight" ]);
  97.                         }
  98.                         return parseInt(this.css("height"));
  99.                 },
  100.                 val:function() {
  101.                         var elem = this[0];
  102.                         if (elem) {
  103.                                 var hooks = jQuery.valHooks[elem.type] || jQuery.valHooks[elem.nodeName.toLowerCase()];
  104.                                 if (hooks && "get" in hooks && (ret = hooks.get(elem, "value")) !== undefined) {
  105.                                         return ret;
  106.                                 }
  107.                                 ret = elem.value;

  108.                                 return typeof ret === "string" ? ret.replace(/\r/g, ""):ret == null ? "":ret;
  109.                         }
  110.                         return "";
  111.                 },
  112.                 attr:function(name, value) {
  113.                         if (value == undefined) {
  114.                                         if(name=="value"){
  115.                                                 return this.val();
  116.                                         }
  117.                         }
  118.                         var elem = this[0];
  119.                         if(elem){
  120.                                 return jQuery.attr(elem, name, value);
  121.                         }
  122.                 },
  123.                 removeClass:function(){
  124.                         var elem = this[0];
  125.                         if(elem){
  126.                                 elem.className="";
  127.                         }
  128.                 },
  129.                 toggle:function(){
  130.                         var elem = this[0];
  131.                         if(elem){
  132.                                 var cur=elem.style.display;
  133.                                 if("none"==cur){
  134.                                         this.show();
  135.                                 }else{
  136.                                         this.hide();
  137.                                 }
  138.                         }
  139.                 },
  140.                 hasClass: function(selector) {
  141.                         var className = " " + selector + " ",
  142.                                 i = 0,
  143.                                 l = this.length;
  144.                         for ( ; i < l; i++ ) {
  145.                                 if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) {
  146.                                         return true;
  147.                                 }
  148.                         }

  149.                         return false;
  150.                 },
  151.                 addClass:function(value){
  152.                         var elem = this[0];
  153.                         if(elem){
  154.                                 elem.className=value;
  155.                         }
  156.                 },
  157.                 show:function(){
  158.                         var elem = this[0];
  159.                         if(elem){
  160.                                 elem.style.display = "block";
  161.                         }
  162.                 },
  163.                 hide:function(){
  164.                         var elem = this[0];
  165.                         if(elem){
  166.                                 elem.style.display = "none";
  167.                         }
  168.                 },
  169.                 fadeOut:function(){
  170.                         this.hide();
  171.                 },
  172.                 fadeIn:function(){
  173.                         this.show();
  174.                 },
  175.                 slideDown:function(time,fn){
  176.                         this.show();
  177.                         if(fn){
  178.                                 fn();
  179.                         }
  180.                 },
  181.            slideUp:function(time,fn){
  182.                         this.hide();
  183.                         if(fn){
  184.                                 fn();
  185.                         }
  186.                 },
  187.                 children: function(filter) {
  188.                         var elem=this[0];
  189.                         var r = [];
  190.                         if(elem){
  191.                                 var elems= jQuery.sibling( elem.firstChild );
  192.                                 if(elems.length>0){
  193.                                         for(var i=0;i<elems.length;i++){
  194.                                                 var temp=elems[i];
  195.                                                 if(filter&&filter.indexOf(".")!=-1){
  196.                                                         if(temp&&("."+temp.className)==filter){
  197.                                                                 r.push( jQuery(temp));
  198.                                                         }
  199.                                                 }else if(filter){
  200.                                                         if(elems.nodeName.toLowerCase==filter.toLowerCase){
  201.                                                                 r.push( jQuery(temp ));
  202.                                                         }
  203.                                                 }else{
  204.                                                         r.push( jQuery(temp ));
  205.                                                 }
  206.                                        
  207.                                         }
  208.                                 }
  209.                         }
  210.                         return r;
  211.                 },
  212.                 iphoneStyle:function(on,off,onShow,offShow) {
  213.                         var elem=this[0];
  214.                         var that=this;
  215.                         if(elem){
  216.                                 if(on&&off){
  217.                                         onShow=onShow||on;
  218.                                         offShow=offShow||off;
  219.                                         var id=this.attr("id")+"_iphone";
  220.                                         var id_on=this.attr("id")+"_iphone_on";
  221.                                         var id_off=this.attr("id")+"_iphone_off";
  222.                                         var content="<DIV id='"+id+"'><table><tr><td><div id='"+id_on+"' class='iphone_on'>"+onShow+"</div></td><td><div id='"+id_off+"' class='iphone_off'>"+offShow+"</div></td></tr></table></DIV>";
  223.                                         this.hide();
  224.                                         this.after(content);
  225.                                         if(that.attr("checked")){
  226.                                                 $("#"+id).removeClass("checkOff");
  227.                                                 $("#"+id).addClass("checkOn");
  228.                                                 $("#"+id).attr("val",on);
  229.                                                 that.attr("value",on);
  230.                                                 that.attr("val",on);
  231.                                         }else{
  232.                                                 $("#"+id).removeClass("checkOn");
  233.                                                 $("#"+id).addClass("checkOff");
  234.                                                 $("#"+id).attr("val",off);
  235.                                                 that.attr("value",off);
  236.                                                 that.attr("val",off);
  237.                                         }
  238.                                         $("#"+id).click(function(){
  239.                                                 if($("#"+id).attr("val")!=on){
  240.                                                         $("#"+id).removeClass("checkOff");
  241.                                                         $("#"+id).addClass("checkOn");
  242.                                                         $("#"+id).attr("val",on);
  243.                                                         that.attr("value",on);
  244.                                                         that.attr("val",on);
  245.                                                 }else{
  246.                                                         $("#"+id).removeClass("checkOn");
  247.                                                         $("#"+id).addClass("checkOff");
  248.                                                         $("#"+id).attr("val",off);
  249.                                                         that.attr("value",off);
  250.                                                         that.attr("val",off);
  251.                                                         clearCookies();
  252.                                                 }
  253.                                         });
  254.                                 }else{
  255.                                         jQuery.error("请指定on and off in iphoneStyle!")
  256.                                 }
  257.                        
  258.                         }
  259.                 },
  260.                 after:function(content){
  261.                         var elem=this[0];
  262.                         if(elem){
  263.                                 if ( elem.parentNode ) {
  264.                                         var tmp=document.createElement("div");
  265.                                         var rxhtmlTag=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig
  266.                                         tmp.innerHTML =  content.replace( rxhtmlTag, "<$1></$2>" );
  267.                                         tmp = tmp.lastChild;
  268.                                         elem.parentNode.insertBefore( tmp, elem.nextSibling );
  269.                                 }
  270.                         }
  271.                 },
  272.                 css:function(name, value) {
  273.                         var elem = this[0];
  274.                         if(elem){
  275.                                 return jQuery.css(elem, name, value);
  276.                         }
  277.                 }
  278.                
  279.         });
  280.         // 浏览器的支持特性
  281.         jQuery.support = (function() {
  282.                 var div = document.createElement("div");
  283.                 div.setAttribute("className", "t");
  284.                 div.innerHTML = "  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
  285.                 a = div.getElementsByTagName("a")[0];
  286.                 if (!a) {
  287.                         a.style.cssText = "top:1px;float:left;opacity:.5";
  288.                 }

  289.                 var support = {
  290.                         getSetAttribute:div.className !== "t",
  291.                         cssFloat:!!a.style.cssFloat,
  292.                         style:/top/.test(a.getAttribute("style"))
  293.                 }
  294.                 return support;
  295.         })();
  296.         // 标准方法
  297.         jQuery.extend({
  298.                 ajaxSetup:function(){
  299.                         //没有任何设置,只是防止异常
  300.                 },
  301.                 trim:function(text) {
  302.                         return text == null ? "":(text + "").replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
  303.                 },
  304.                 isIE6:function(){
  305.                         return !-[1,]&&!window.XMLHttpRequest;
  306.                 },
  307.                 error:function(msg) {
  308.                         throw new Error(msg);
  309.                 },
  310.                 isWindow: function( obj ) {
  311.                         return obj != null && obj == obj.window;
  312.                 },
  313.                 sibling: function( n, elem ) {
  314.                         var r = [];
  315.                         for ( ; n; n = n.nextSibling ) {
  316.                                 if ( n.nodeType === 1 && n !== elem ) {
  317.                                         r.push( n );
  318.                                 }
  319.                         }
  320.                         return r;
  321.                 },
  322.                 parseJSON:function(data) {
  323.                         if (window.JSON && window.JSON.parse) {
  324.                                 return window.JSON.parse(data);
  325.                         }
  326.                         if (data === null) {
  327.                                 return data;
  328.                         }
  329.                         if (typeof data === "string") {
  330.                                 data = jQuery.trim(data);
  331.                                 if (data) {
  332.                                         var rvalidchars = /^[\],:{}\s]*$/, rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g, rvalidescape = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g, rvalidtokens = /"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g;
  333.                                         if (rvalidchars.test(data.replace(rvalidescape, "@").replace(rvalidtokens, "]").replace(rvalidbraces, ""))) {
  334.                                                 return (new Function("return " + data))();
  335.                                         }
  336.                                 }
  337.                         }

  338.                         jQuery.error("Invalid JSON: " + data);
  339.                 },
  340.                 getAjaxHttp:function() {
  341.                         try {
  342.                                 return new window.XMLHttpRequest();
  343.                         } catch (e) {
  344.                                 try {
  345.                                         return new window.ActiveXObject("Microsoft.XMLHTTP");
  346.                                 } catch (e) {
  347.                                         jQuery.error("getAjaxHttp  error");
  348.                                 }
  349.                         }
  350.                 },
  351.                 getJSON:function(url, data, callback) {
  352.                         if (!data) {
  353.                                 data = {};
  354.                         }
  355.                         var append = "";
  356.                         for (key in data) {
  357.                                 append = append + "&" + encodeURIComponent(key) + "=" + encodeURIComponent(data[key]);
  358.                         }
  359.                         if (append.length > 0 && url.indexOf("?") == -1) {
  360.                                 append = "?" + append.substring(1);
  361.                         }
  362.                         if (append.length > 0){
  363.                                 append =  append.substring(1);
  364.                         }
  365.                         jQuery.post(url,append,function(content){
  366.                                         callback(jQuery.parseJSON(content));
  367.                         })
  368.                 },
  369.                 getAjaxContent:function(url, data, callback) {
  370.                         if (!data) {
  371.                                 data = {};
  372.                         }
  373.                         var append = "";
  374.                         for (key in data) {
  375.                                 append = append + "&" + encodeURIComponent(key) + "=" + encodeURIComponent(data[key]);
  376.                         }
  377.                         if (append.length > 0 && url.indexOf("?") == -1) {
  378.                                 append = "?" + append.substring(1);
  379.                         }
  380.                         if (append.length > 0){
  381.                                 append =  append.substring(1);
  382.                         }
  383.                         jQuery.post(url,append,function(content){
  384.                                         callback(content);
  385.                         })
  386.                 },
  387.                 get:function(url,callback) {
  388.                         var request = jQuery.getAjaxHttp();
  389.                         request.onreadystatechange = function() {
  390.                                 if (request.readyState == 4 && request.status == 200) {
  391.                                         callback(request.responseText);
  392.                                 }
  393.                         }
  394.                         request.open("get", url, true);
  395.                         request.send(null);
  396.                 },
  397.                 post:function(url,data,callback) {
  398.                         var request = jQuery.getAjaxHttp();
  399.                         request.onreadystatechange = function() {
  400.                                 if (request.readyState == 4 && request.status == 200) {
  401.                                         callback(request.responseText);
  402.                                 }
  403.                         }
  404.                         request.open("post", url, true);
  405.                         request.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");  
  406.                         request.send(data);
  407.                 },
  408.                 each:function(obj, callback, args) {
  409.                         var value, i = 0, length = obj.length;
  410.                         if (args) {
  411.                                 for (; i < length; i++) {
  412.                                         value = callback.apply(obj[i], args);
  413.                                         if (value === false) {
  414.                                                 break;
  415.                                         }
  416.                                 }
  417.                         } else {
  418.                                 for (; i < length; i++) {
  419.                                         value = callback.call(obj[i], i, obj[i]);
  420.                                         if (value === false) {
  421.                                                 break;
  422.                                         }
  423.                                 }
  424.                         }
  425.                         return obj;
  426.                 },
  427.                 cssProps:{
  428.                         "float":jQuery.support.cssFloat ? "cssFloat":"styleFloat"
  429.                 },
  430.                 camelCase:function(string) {
  431.                         return string.replace(/^-ms-/, "ms-").replace(/-([\da-z])/gi, function(all, letter) {
  432.                                 return letter.toUpperCase();
  433.                         });
  434.                 },
  435.                 css:function(elem, name, value) {
  436.                         if (value !== undefined) {
  437.                                 if (typeof name === "string") {
  438.                                         var type = typeof value;
  439.                                         if ( type === "number") {
  440.                                                 value += "px";
  441.                                         }
  442.                                         var name = jQuery.camelCase(name);
  443.                                         elem.style[name]=value;
  444.                                 }
  445.                         } else {
  446.                                 if (typeof name === "string") {
  447.                                                 var name = jQuery.camelCase(name);
  448.                                                 var val;
  449.                                                 name = jQuery.cssProps[name] || name
  450.                                                 var hooks = jQuery.cssHooks[name] || jQuery.cssHooks[name];
  451.                                                 if (hooks && "get" in hooks) {
  452.                                                         val = hooks.get(elem);
  453.                                                 }
  454.                                                 if(window.getComputedStyle){
  455.                                                         var computed=window.getComputedStyle( elem, null );
  456.                                                         val = computed ? computed[ name ]  || computed.getPropertyValue( name ): undefined;
  457.                                                 }
  458.                                                 if (val === undefined) {
  459.                                                         val = elem.style[name];
  460.                                                 }
  461.                                                 if(!val){
  462.                                                         val=elem.currentStyle[name]
  463.                                                 }
  464.                                                 return val;
  465.                                 }else{
  466.                                         for(key in name){
  467.                                                 var val=name[key];
  468.                                                 var type = typeof val;
  469.                                                 if ( type === "number") {
  470.                                                         val += "px";
  471.                                                 }
  472.                                                 elem.style[ jQuery.camelCase(key)]=val;
  473.                                         }
  474.                                         return;
  475.                                 }
  476.                         }

  477.                 },
  478.                 attr:function(elem, name, value) {
  479.                         var ret, hooks, nType = elem.nodeType;
  480.                         if (!elem || nType === 3 || nType === 8 || nType === 2) {
  481.                                 return;
  482.                         }
  483.                         name = name.toLowerCase();
  484.                         try{
  485.                                 hooks = jQuery.valHooks[elem.type] ||jQuery.attrHooks[name] || jQuery.cssHooks[name]  ;
  486.                         }catch(e){
  487.                                 return;
  488.                         }
  489.                         if (value !== undefined) {
  490.                                 if (value === null) {
  491.                                         elem.removeAttribute(name);
  492.                                 } else if (hooks && "set" in hooks && (ret = hooks.set(elem, value, name)) !== undefined) {
  493.                                         return ret;
  494.                                 } else {
  495.                                         elem.setAttribute(name, value + "");
  496.                                         return value;
  497.                                 }
  498.                         } else if (hooks && "get" in hooks && (ret = hooks.get(elem, name)) !== null) {
  499.                                 return ret;
  500.                         } else {
  501.                                 if (typeof elem.getAttribute !== "undefined") {
  502.                                         ret = elem.getAttribute(name);
  503.                                 }
  504.                                 if(ret){
  505.                                         return ret;
  506.                                 }else{
  507.                                         return "";
  508.                                 }
  509.                         }
  510.                 },
  511.                 inArray:function(elem, arr, i) {
  512.                         var len;
  513.                         if (arr) {
  514.                                 len = arr.length;
  515.                                 i = i ? i < 0 ? Math.max(0, len + i):i:0;
  516.                                 for (; i < len; i++) {
  517.                                         if (i in arr && arr[i] === elem) {
  518.                                                 return i;
  519.                                         }
  520.                                 }
  521.                         }
  522.                         return -1;
  523.                 },
  524.                 attrHooks:{

  525.                 },
  526.                 cssHooks:{

  527.                 },
  528.                 valHooks:{
  529.                         option:{
  530.                                 get:function(elem) {
  531.                                         var val = elem.attributes.value;
  532.                                         return !val || val.specified ? elem.value:elem.text;
  533.                                 }
  534.                         },
  535.                         input:{
  536.                                 get:function(elem) {
  537.                                         return elem.value;
  538.                                 },
  539.                                 set:function(elem, value) {
  540.                                         return elem.value = value;
  541.                                 }
  542.                         },
  543.                         select:{
  544.                                 get:function(elem) {
  545.                                         var value, option, options = elem.options, index = elem.selectedIndex, one = elem.type === "select-one" || index < 0, values = one ? null:[], max = one ? index + 1:options.length, i = index < 0 ? max:one ? index:0;
  546.                                         for (; i < max; i++) {
  547.                                                 option = options[i];
  548.                                                 if (option.selected || i === index) {
  549.                                                         value = jQuery(option).val();
  550.                                                         if (one) {
  551.                                                                 return value;
  552.                                                         }
  553.                                                         values.push(value);
  554.                                                 }
  555.                                         }
  556.                                         return values;
  557.                                 },
  558.                                 set:function(elem, values) {
  559.                                         if (!values.length) {
  560.                                                 values = [ values ];
  561.                                         }
  562.                                         var value, option, options = elem.options;
  563.                                         var max = options.length;
  564.                                         for (i = 0; i < max; i++) {
  565.                                                 value = jQuery(option[i]).val();
  566.                                                 this.selected = jQuery.inArray(value, values) >= 0;
  567.                                         }
  568.                                         return values;
  569.                                 }
  570.                         }
  571.                 }
  572.         });
  573.         // 修补一些浏览器的bug
  574.         if (!jQuery.support.getSetAttribute) {
  575.                 jQuery.each([ "width", "height" ], function(i, name) {
  576.                         jQuery.attrHooks[name] = jQuery.extend(jQuery.attrHooks[name], {
  577.                                 set:function(elem, value) {
  578.                                         if (value === "") {
  579.                                                 elem.setAttribute(name, "auto");
  580.                                                 return value;
  581.                                         }
  582.                                 }
  583.                         })
  584.                 });
  585.         }
  586.         if (!jQuery.support.style) {
  587.                 jQuery.attrHooks.style = {
  588.                         get:function(elem) {
  589.                                 return elem.style.cssText || undefined;
  590.                         },
  591.                         set:function(elem, value) {
  592.                                 return (elem.style.cssText = value + "");
  593.                         }
  594.                 };
  595.         }
  596.         ;
  597.         jQuery.each(("blur focus focusin focusout load resize scroll unload click dblclick " + "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + "change select submit keydown keypress keyup error contextmenu").split(" "), function(i, name) {
  598.                 jQuery.fn[name] = function() {
  599.                         var elem = this[0];
  600.                         if(elem){
  601.                                 if(arguments.length>0){
  602.                                         var eventHandle=arguments[0];
  603.                                         if (elem.addEventListener) {
  604.                                                 elem.addEventListener(name, eventHandle, false);
  605.                                         } else if (elem.attachEvent) {
  606.                                                 elem.attachEvent("on" + name, eventHandle);
  607.                                         }
  608.                                 }else{
  609.                                         try{
  610.                                                 var meth=elem[name];
  611.                                                 meth.call(elem);
  612.                                         }catch(e){
  613.                                           if(name=="click"){
  614.                                                   if(document.all){  
  615.                                     elem.click();  
  616.                                 }else{  
  617.                                     var evt = document.createEvent("MouseEvents");  
  618.                                     evt.initEvent("click", true, true);  
  619.                                     elem.dispatchEvent(evt);  
  620.                                 }  
  621.                                           }
  622.                                         }
  623.                                 }
  624.                         }
  625.                        
  626.                 };
  627.         });
  628.         jQuery.each([ "height", "width" ], function(i, name) {
  629.                 jQuery.cssHooks[name] = {
  630.                         get:function(elem) {
  631.                                 var val = name === "width" ? elem.offsetWidth:elem.offsetHeight;
  632.                                 if (val <= 0 || val == null) {
  633.                                         val = elem.style[name];
  634.                                         val = parseFloat(val) || 0;
  635.                                 }
  636.                                 return val + "px";
  637.                         }
  638.                 };
  639.         });
  640.         window.jQuery = window.$ = jQuery;
  641. })(window);


  642. /*var search = window.location.search;
  643. var parameters = search.replace("?", "").split("&");
  644. var pos, paraName, paraValue;
  645. if (parameters && parameters != "") {
  646.     for (var i = 0; i < parameters.length; i++) {
  647.         pos = parameters[i].indexOf("=");
  648.         paraName = parameters[i].substring(0, pos);
  649.         paraValue = parameters[i].substring(pos + 1);
  650.         eval("var " + paraName + "='" + paraValue + "'")
  651.     }
  652. }*/

  653. function doauthen() {
  654.         $("#serviceShowHide").hide();
  655.         $("#isUsernameErrorImg").hide();
  656.         $("#isPwdErrorImg").hide();
  657.         $("#isServiceErrorImg").hide();
  658.         $("#isValidCodeErrorImg").hide();
  659.         $("#serviceShowHideTop").css("background-position", "-373px 0px");
  660.         $("#username_hk_posi").css("background-position", "-373px 0px");
  661.         $("#pwd_hk_posi").css("background-position", "-373px 0px");
  662.         $("#left_hk_regist_validcode").css("background-position", "-373px 0px");
  663.     disableLoginButton();
  664.     if (checkForm() == true) {
  665.         // 改为使用接口认证
  666.         var queryString = encodeURIComponent(encodeURIComponent(getQueryString()));
  667.          //勾选系统配置--服务配置--域名就将用户名拼接成用户名@服务名
  668.         var username=document.getElementById("username").value;
  669.         var domainName="";
  670.       /*  if(document.getElementById("isNoDomainName")){
  671.                 domainName=document.getElementById("isNoDomainName").value;
  672.                 if(domainName=='true'){
  673.                           var temp=document.getElementById("net_access_type");
  674.                           if(temp){
  675.                                   username=username+"@"+temp.value;
  676.                           }
  677.           }
  678.         }*/
  679.         
  680.         
  681.         var tj=document.getElementById("Tj_yes");
  682.         if (tj.style.display == "block" || tj.style.display == "") {
  683.                 username=prefixValue+username;
  684.         }
  685.         var userId = encodeURIComponent(encodeURIComponent(username));
  686.         var password = encodeURIComponent(encodeURIComponent(document.getElementById("pwd").value));
  687.         var service = "";
  688.         if(document.getElementById("net_access_type")){
  689.                         service = encodeURIComponent(encodeURIComponent(document.getElementById("net_access_type").value));
  690.         }
  691.         var operatorPwd="";
  692.         var operatorUserId="";
  693.         if(document.getElementById('isNoOperatorPasswordFrameId')){
  694.           //运营商密码框是否显示
  695.           var isOperatorhide=document.getElementById('isNoOperatorPasswordFrameId').style.display;
  696.           //显示运营商密码框则提交数据---校验
  697.           if(isOperatorhide!="none"){
  698.                   operatorPwd=encodeURIComponent(encodeURIComponent(document.getElementById("operatorPwd").value));
  699.           }
  700.         }
  701.         
  702.         if(document.getElementById('isNoOperatorUserIdFrameId')){
  703.           //运营商用户名框是否显示
  704.           var isOperatorUserIdhide=document.getElementById('isNoOperatorUserIdFrameId').style.display;
  705.           //显示运营商用户名框框则提交数据---校验
  706.           if(isOperatorUserIdhide!="none"){
  707.                   operatorUserId=encodeURIComponent(encodeURIComponent(document.getElementById("operatorUserId").value));
  708.           }
  709.         }
  710.         
  711.         var code="";
  712.         var isDisplayValidCode=document.getElementById('isDisplayValidCode').style.display;
  713.         if(isDisplayValidCode!="none"){
  714.                 code=document.getElementById("validCode").value;
  715.                 if(code==""){
  716.                         showerror("验证码不能为空.",5);
  717.                         return false;
  718.                 }
  719.         }
  720.         AuthInterFace.init("./");
  721.         AuthInterFace.login(userId,password,service,queryString,operatorPwd,operatorUserId,code,function(authResult){
  722.                  if(authResult.result=="success"){
  723.                    if(authResult.message&&authResult.message!=""){
  724.                            alert(authResult.message);
  725.                    }
  726.                    var c = document.getElementById("disPlayIs_check_no");
  727.                    var a = document.getElementById("disPlayClearSave_yes");
  728.                    var d = document.getElementById("disPlayClearTj_yes");
  729.                    var b = document.getElementById("disPlayIs_tj_no");
  730.                    if (a.style.display == "block" || a.style.display == "") {
  731.                        if (document.getElementById("username")) {
  732.                            setCookies("EPORTAL_COOKIE_USERNAME", document.getElementById("username").value)
  733.                        }
  734.                        if (document.getElementById("pwd")) {
  735.                            setCookies("EPORTAL_COOKIE_PASSWORD", document.getElementById("pwd").value)
  736.                        }
  737.                        if (document.getElementById("net_access_type")) {
  738.                            setCookies("EPORTAL_COOKIE_SERVER", document.getElementById("net_access_type").value);
  739.                            setCookies("EPORTAL_COOKIE_SERVER_NAME", document.getElementById("selectDisname").innerHTML)
  740.                        }
  741.                        if(document.getElementById("operatorPwd")){
  742.                                      setCookies("EPORTAL_COOKIE_OPERATORPWD", document.getElementById("operatorPwd").value);
  743.                              }
  744.                    } else {
  745.                        if (c.style.display == "block" || c.style.display == "") {
  746.                            setCookies("EPORTAL_COOKIE_USERNAME", "");
  747.                            setCookies("EPORTAL_COOKIE_PASSWORD", "");
  748.                            setCookies("EPORTAL_COOKIE_SERVER", "");
  749.                            setCookies("EPORTAL_COOKIE_SERVER_NAME", "")
  750.                            setCookies("EPORTAL_COOKIE_OPERATORPWD","");
  751.                        }
  752.                    }
  753.                    if (d.style.display == "block" || d.style.display == "") {
  754.                        setCookies("EPORTAL_AUTO_LAND", "true")
  755.                    } else {
  756.                        setCookies("EPORTAL_AUTO_LAND", "")
  757.                    }
  758.                   
  759.                if(successPage&&successPage!=''&&successPage=="true"){
  760.                        
  761.                  var newWin;
  762.                  var _width=document.body.clientWidth-300;
  763.                  var _height=document.body.clientHeight-150;
  764.                  newWin =  window.open ('success.jsp?page=min', '认证成功页面', 'height=100,width=250,top="'+_height+'",left="'+_width+'",toolbar=no,menubar=no, scrollbars=no, resizable=no,location=no, status=no'); //这句要写
  765.                        newWin.location.href = "success.jsp?userIndex="+authResult.userIndex+"&keepaliveInterval="+authResult.keepaliveInterval+"&page=min";
  766.                   AuthInterFace.getOnlineUserInfo(authResult.userIndex,function(onlineUserInfo){
  767.                                    var userUrl = onlineUserInfo.userUrl;
  768.                        if (userUrl && userUrl != "") {
  769.                                   window.location.href=userUrl;
  770.                        }
  771.                   });
  772.                }else{
  773.                         window.location="success.jsp?userIndex="+authResult.userIndex+"&keepaliveInterval="+authResult.keepaliveInterval;
  774.                }
  775.                  }else{
  776.                            //认证失败,清除cookie中的服务选项
  777.                                 setCookies("EPORTAL_COOKIE_SERVER", "");
  778.                     setCookies("EPORTAL_COOKIE_SERVER_NAME", "");
  779.                                          var url=authResult.validCodeUrl;
  780.                                          if(url!=null&&url!=""){
  781.                                                  $("#validImage").attr("src",url);
  782.                                                  $("#isDisplayValidCode").show();
  783.                                                 $("#isDisplayValidCodeTip").show();
  784.                                          }
  785.                                         var message=authResult.message;
  786.                                         //认证失败的地方
  787.                                         if(message.indexOf("ERR_USER_FIRSTLOGIN_NEED_CHANGE_PASSWORD")>-1){
  788.                                                 if(userId!=null&&password!=null){
  789.                                                         document.getElementById("userIdHj").value =userId;
  790.                                                         document.getElementById("passHj").value =password;
  791.                                                         document.getElementById("haiJunForm").submit();
  792.                                                         return;
  793.                                                 }
  794.                                         }
  795.                                    if(message.indexOf("网络协议书")>-1){
  796.                                            errorTip=true;
  797.                                            opensetting();
  798.                                    }else if(shouldDisplayOperatorInfo(message)){
  799.                                                    document.getElementById("isNoOperatorPasswordFrameId").style.display="block";
  800.                                                                document.getElementById("isNoOperatorPasswordFrameId_space").style.display="block";
  801.                                                                      document.getElementById("isNoOperatorUserIdFrameId").style.display="block";
  802.                                                                document.getElementById("isNoOperatorUserIdFrameId_space").style.display="block";
  803.                                                                
  804.                                                                if(document.getElementById("selectDisname").innerHTML &&
  805.                                                                                document.getElementById("selectDisname").innerHTML!="" &&
  806.                                                                                document.getElementById("selectDisname").innerHTML!="请选择服务"){
  807.                                                                        $("#operatorUserId_tip").attr("value","请输入"+document.getElementById("selectDisname").innerHTML+"对应的账号");
  808.                                                                        $("#operatorPwd_tip").attr("value","请输入"+document.getElementById("selectDisname").innerHTML+"对应的密码");
  809.                                                                }
  810.                                                                
  811.                                                                       
  812.                                                                       if(message.indexOf("<OperatorId>")){
  813.                                                                               operatorInfo = message.split("<OperatorId>");
  814.                                                                               message=operatorInfo[0];
  815.                                                                               if(operatorInfo.length>1){
  816.                                                                                      document.getElementById("operatorUserId").value =operatorInfo[1] ;
  817.                                                                                $("#operatorUserId_tip").focus();
  818.                                                                               }
  819.                                                                       }
  820.                                                                       
  821.                                                                      showerror(message);
  822.                                    }else{
  823.                                     if(message.indexOf("<OperatorId>")){
  824.                                                               operatorInfo = message.split("<OperatorId>");
  825.                                                               message=operatorInfo[0];
  826.                                     }
  827.                                            showerror(message);
  828.                                            if(errorTip){
  829.                                                    errorTip=false;
  830.                                                    closeSubPage();
  831.                                            }
  832.                                             // 显示错误信息
  833.                                    }
  834.            }
  835.         });
  836.     }
  837. }


  838. function shouldDisplayOperatorInfo(errorMessage){

  839.         var errorMessages = $("#countTrId").attr("errorMessages");
  840.        
  841.         if(errorMessages==null || errorMessages=="" || errorMessages == "null") {
  842.                 return false;
  843.         }
  844.         var errors = errorMessages.split("<errorMessage>");
  845.         if(errors.length>0){
  846.                 for(var i=0;i<errors.length;i++){
  847.                         if(errorMessage.match(errors[i])!=null){
  848.                                 return true;
  849.                         }
  850.                 }
  851.         }
  852.         return false;
  853. }

  854. var errorTip=false;
  855. function registerNetWorkProtocol(){
  856.                 var userId=$("#username").val();
  857.                 if(userId&&userId!=''){
  858.                         AuthInterFace.init("./");
  859.                         AuthInterFace.registerNetWorkProtocol(userId,function(procotol){
  860.                                 if(procotol.result=='ok'){
  861.                                         doauthen();
  862.                                 }else{
  863.                                         alert("注册网络协议书失败!请重新登陆!");
  864.                                  closeSubPage();
  865.                                 }
  866.                         });
  867.                 }
  868.         }
  869. //勾选记住密码
  870. function checkIsChooseTj() {
  871.     jQuery("#disPlayClearTj_yes").show();
  872.     jQuery("#disPlayIs_tj_no").hide();
  873.     jQuery("#disPlayClearSave_yes").show();
  874.     jQuery("#disPlayIs_check_no").hide()
  875.     setCookies("EPORTAL_COOKIE_SAVEPASSWORD", "true");
  876. }
  877. //勾选自动登录
  878. function checkClearTjChoose() {
  879.     jQuery("#disPlayClearTj_yes").hide();
  880.     jQuery("#disPlayIs_tj_no").show();
  881. }

  882. function disableLoginButton() {
  883.     if (document.getElementById("loginLink")) {
  884.         document.getElementById("loginLink").disabled = true
  885.     }
  886. }
  887. function ableLoginButton() {
  888.     if (document.getElementById("loginLink")) {
  889.         document.getElementById("loginLink").disabled = false
  890.     }
  891. }
  892. function escape2Unicode(a) {
  893.     return a.replace(/&#(x)?([^&]{1,5});?/g, function (e, d, f) {
  894.         return String.fromCharCode(parseInt(f, d ? 16 : 10));
  895.     })
  896. }

  897. function checkForm() {
  898.     var a = $("#username").attr("value");
  899.     if (a == "" || a == null) {
  900.         showerror("&#35831;&#22635;&#20889;&#29992;&#25143;&#21517;&#33;",1);
  901.         return false
  902.     }
  903.     var a_new = a.replace(/^\s+|\s+$/g,'');
  904.     if (a_new == null || (a_new != null && a_new.length != a.length)){
  905.                 showerror('用户名首尾不能包含空格!',1);
  906.                 return false;
  907.     }
  908.     if ($("#pwd").attr("value") == "") {
  909.         showerror("&#35831;&#22635;&#20889;&#23494;&#30721;&#33;", 2);
  910.         return false
  911.     }
  912.    
  913.    
  914.     if(document.getElementById('isNoOperatorUserIdFrameId')){
  915.       //运营商密码框是否显示
  916.       var isOperatorhide=document.getElementById('isNoOperatorUserIdFrameId').style.display;
  917.       //显示运营商密码框则提交数据---校验
  918.       if(isOperatorhide!="none"){
  919.               var operatorUserId=$("#operatorUserId").attr("value");
  920.               if(operatorUserId==''){
  921.                       showerror('运营商账号不能为空',7);
  922.                       return false;
  923.               }
  924.               if(operatorUserId.indexOf('>')>-1){
  925.                       showerror('运营商账号不能包含特殊符号',7);
  926.                       return false;
  927.               }
  928.       }else{
  929.               document.getElementById("operatorUserId").value="";
  930.       }
  931.     }
  932.    
  933.    
  934.     if(document.getElementById('isNoOperatorPasswordFrameId')){
  935.       //运营商密码框是否显示
  936.       var isOperatorhide=document.getElementById('isNoOperatorPasswordFrameId').style.display;
  937.       //显示运营商密码框则提交数据---校验
  938.       if(isOperatorhide!="none"){
  939.               var operatorPwd=$("#operatorPwd").attr("value");
  940.               if(operatorPwd==''){
  941.                       showerror('运营商密码不能为空',6);
  942.                       return false;
  943.               }
  944.               if(operatorPwd.indexOf('>')>-1){
  945.                       showerror('运营商密码不能包含特殊符号',6);
  946.                       return false;
  947.               }
  948.       }else{
  949.               document.getElementById("operatorPwd").value="";
  950.               setCookies("EPORTAL_COOKIE_OPERATORPWD","");
  951.       }
  952.     }
  953.    
  954.     if ($("#uuidQrCode").val("value") == "") {
  955.              if (document.getElementById("isDisplayServicesTip").style.display!="none"){
  956.                              if ($("#net_access_type").val("value") == "" && $("#username").attr("value").indexOf("``") == -1) {
  957.                    showerror("请选择服务",3);
  958.                    return false
  959.                }
  960.              }
  961.     }
  962.     var jsonTemp="";
  963.           try{
  964.                           jsonTemp=decodeURIComponent(getCookie("servicesJsonStr"));
  965.           }catch(e2){
  966.                   //alert(e2);
  967.           }
  968.           if(jsonTemp&&jsonTemp!=null&&jsonTemp!=""&&jsonTemp!="null"&&jsonTemp.length>0){
  969.                    var tempBchs=jsonTemp.split("@%%username@%%");
  970.                    var name=document.getElementById("username").value;
  971.                    if(tempBchs.length>1&&tempBchs[0]!=name){
  972.                            setCookies("servicesJsonStr",encodeURIComponent(name+"@%%username@%%"+tempBchs[1]));
  973.                    }
  974.           }
  975.     return true
  976. }
  977. function showerror(c, a) {
  978.                     ableLoginButton();
  979.         showAuthFailMessage_hk(c, a);
  980.         try {
  981.             freshImage()
  982.         } catch (b) {
  983.         }
  984.     }
  985. function freshImage() {
  986.         jQuery("#validImage").attr("src", "./validcode?rnd=?" + Math.random());
  987. }
  988. function imgLoadFail(b) {
  989.     var a = $("#" + b);
  990.     if (a) {
  991.         a.attr("src", a.attr("val"))
  992.     }
  993. }
  994. function showAuthFailMessage_hk(b, a) {
  995.     $("#errorInfo_hk").show();
  996.     $("#errorInfo_tupian").show();
  997.     jQuery("#errorInfo_center").html("<span id='error_span_content'>" + b + "</span>");
  998.     jQuery("#errorInfo_center").attr("val", b);
  999.     switch(a){
  1000.             case 1:
  1001.                     $("#username_tip").focus();
  1002.               $("#isUsernameErrorImg").show();
  1003.               $("#username_hk_posi").css("background-position", "-373px -64px");
  1004.               break;
  1005.             case 2:
  1006.                     $("#pwd_tip").focus();
  1007.               $("#isPwdErrorImg").show();
  1008.               $("#pwd_hk_posi").css("background-position", "-373px -64px");
  1009.               break;
  1010.             case 3:
  1011.                      $("#isServiceErrorImg").show();
  1012.                $("#serviceShowHideTop").css("background-position", "-373px -64px");
  1013.                break;
  1014.             case 4:
  1015.                      break;
  1016.             case 5:
  1017.                      $("#isValidCodeErrorImg").show();
  1018.                 break;
  1019.             case 6:
  1020.                     $("#isOperatorPwdErrorImg").show();
  1021.                     $("#operatorPwd_hk_posi").css("background-position", "-373px -64px");
  1022.                     break;
  1023.             case 7:
  1024.                     $("#isOperatorUserIdErrorImg").show();
  1025.                     $("#operatorUserId_hk_posi").css("background-position", "-373px -64px");
  1026.                     break;
  1027.     }
  1028. }

  1029. function setCookies(a, b) {
  1030.     var c = new Date();
  1031.     c.setTime(c.getTime() + 1000 * 24 * 3600 * 1000);
  1032.     document.cookie = a + "=" + encodeURIComponent(b) + "; expires=" + c.toGMTString() + "; path=/eportal/"
  1033. }

  1034. function getCookie(b) {
  1035.     var a = document.cookie.match(new RegExp("(^| )" + b + "=([^;]*)(;|$)"));
  1036.     if (a != null) {
  1037.         return decodeURIComponent(a[2])
  1038.     }
  1039.     return null;
  1040. }

  1041. function delCookie(a) {
  1042.     var b = new Date();
  1043.     b.setTime(b.getTime() - 1);
  1044.     document.cookie = a + "=;expires=" + b.toGMTString() + "; path=/eportal/"
  1045. }

  1046. function getQueryString(){
  1047.         var  queryString = document.location.search;
  1048.         if(queryString!=null&&queryString!=""){
  1049.                 return queryString.substring(1);
  1050.         }else{
  1051.                 return "";
  1052.         }
  1053. }

  1054. function getQueryStringByName(name) {
  1055.   var result = location.search.match(new RegExp("[\?\&]" + name + "=([^\&]+)", "i"));
  1056.   if (result == null || result.length < 1) {
  1057.       return "";
  1058.   }
  1059.   return result[1];
  1060. }

  1061. function initInputFromCookies_hk() {
  1062.     var b = getCookie("EPORTAL_COOKIE_USERNAME");
  1063.     if (b != null && b != "" && document.getElementById("username")) {
  1064.         document.getElementById("username").value = decodeURIComponent(b);
  1065.         document.getElementById("username_tip").focus();
  1066.     }
  1067.     var b = getCookie("EPORTAL_COOKIE_PASSWORD");
  1068.     var flagService = false;
  1069.     if (b != null && b != "" && document.getElementById("pwd")) {
  1070.         document.getElementById("pwd").value = b;
  1071.         document.getElementById("pwd_tip").focus();
  1072.         if (document.getElementById("net_access_type")) {
  1073.             var c = getCookie("EPORTAL_COOKIE_SERVER");
  1074.             var a = getCookie("EPORTAL_COOKIE_SERVER_NAME");
  1075.             if (c == null || c == ""||((null==services||"[]"==services||""==services)&&typeflag!="true")) {
  1076.                 a = $defaultService;
  1077.                 c = $defaultValue;
  1078.                       setCookies("EPORTAL_COOKIE_SERVER", "");
  1079.                       setCookies("EPORTAL_COOKIE_SERVER_NAME", "");
  1080.                       flagService = true;
  1081.             }else{
  1082.                     //portal服务不为空
  1083.                             if((null!=services||"[]"!=services||""!=services)&&"true"!=typeflag){
  1084.                                                     //检测cookie中保存的服务是否正确
  1085.                                                     for(var i=0;i<services.length;i++){
  1086.                                                             var name =services[i].serviceName;
  1087.                                                             if(null!=name && c==name){
  1088.                                                                     a=services[i].serviceShowName;
  1089.                                                                     flagService = true;
  1090.                                                                     break;
  1091.                                                             }
  1092.                                                     }       
  1093.                             }
  1094.                             //portal上开启根据用户名获取服务
  1095.                             if(typeflag=="true"&& null!=c &&  ""!=c){
  1096.                                       flagService = true;
  1097.                             }
  1098.             }
  1099.             if(true==flagService){
  1100.                             document.getElementById("net_access_type").value = c;
  1101.                             $("#selectDisname").html(a);
  1102.             }
  1103.         }
  1104.         jQuery("#disPlayClearSave_yes").show();
  1105.         jQuery("#disPlayIs_check_no").hide()
  1106.     }
  1107.     var coolieoperatorpwd = getCookie("EPORTAL_COOKIE_OPERATORPWD");
  1108.     if(coolieoperatorpwd!=null&&coolieoperatorpwd!=''&&document.getElementById("isNoOperatorPasswordFrameId")&&document.getElementById("isNoOperatorPasswordFrameId").style.display!="none")
  1109.                 {
  1110.            
  1111.             if(document.getElementById("selectDisname").innerHTML &&
  1112.                                   document.getElementById("selectDisname").innerHTML!="" &&
  1113.                                   document.getElementById("selectDisname").innerHTML!="请选择服务"){
  1114.                       $("#operatorPwd_tip").attr("value","请输入"+document.getElementById("selectDisname").innerHTML+"对应的密码");
  1115.             }
  1116.            
  1117.                                 $("#isNoOperatorPasswordFrameId_space").show();
  1118.                                 $("#isNoOperatorPasswordFrameId").show();
  1119.                                 document.getElementById("operatorPwd").value=coolieoperatorpwd;
  1120.                 }
  1121.     var cookiedomian=getCookie("EPORTAL_COOKIE_DOMAIN");
  1122.     if(document.getElementById("isNoDomainName")){
  1123.                         if(cookiedomian!=null&&cookiedomian!=''){
  1124.                                 document.getElementById("isNoDomainName").value=cookiedomian;
  1125.                         }
  1126.                 }
  1127.     var d = getCookie("EPORTAL_AUTO_LAND");
  1128.     if (d == "true") {
  1129.         $("#disPlayClearTj_yes").show();
  1130.         $("#disPlayIs_tj_no").hide();
  1131.     } else {
  1132.         $("#disPlayClearTj_yes").hide();
  1133.         $("#disPlayIs_tj_no").show();
  1134.     }
  1135.     $("#username_tip").focus();
  1136.     $("#username").focus();
  1137. }
  1138. function clickMenu() {
  1139.    $("#username").blur(function () {
  1140.         $("#username_hk_posi").css("background-position", "-373px 0px");
  1141.     });
  1142.     $("#pwd").blur(function () {
  1143.         $("#pwd_hk_posi").css("background-position", "-373px 0px");
  1144.     });
  1145.     $("#loginLink").blur(function () {
  1146.         $("#loginLink_div").css("background-position", "-373px -105px");
  1147.     })
  1148. }
  1149. function jqueryBind() {
  1150.              $("#username_tip").focus(function () {
  1151.                                   //  $("#username").attr("value", "");
  1152.                                     $("#username").show();
  1153.                                     $("#username").focus();
  1154.                                     $("#username_tip").hide();
  1155.                                     $("#serviceShowHide").hide();
  1156.                 });
  1157.                 $("#username_tip").keypress(function () {
  1158.                                   //  $("#username").attr("value", "");
  1159.                                     $("#username").show();
  1160.                                     $("#username").focus();
  1161.                                     $("#username_tip").hide()
  1162.                 });
  1163.                 $("#username").blur(function () {
  1164.                                     if ($("#username").attr("value") == "") {
  1165.                                         $("#username").hide();
  1166.                                         $("#username_tip").show()
  1167.                                     }
  1168.                 });
  1169.                 $("#pwd_tip").focus(function () {
  1170.                //  $("#pwd").attr("value", "");
  1171.                  $("#pwd").show();
  1172.                  $("#pwd").focus();
  1173.                  $("#pwd_tip").hide();
  1174.                  $("#serviceShowHide").hide()
  1175.              });
  1176.              $("#pwd_tip").keypress(function () {
  1177.                //  $("#pwd").attr("value", "");
  1178.                  $("#pwd").show();
  1179.                  $("#pwd").focus();
  1180.                  $("#pwd_tip").hide()
  1181.              });
  1182.              $("#pwd").blur(function () {
  1183.                  if ($("#pwd").attr("value") == "") {
  1184.                      $("#pwd").hide();
  1185.                      $("#pwd_tip").show()
  1186.                  }
  1187.              });
  1188.         initInputFromCookies_hk();
  1189.         clickMenu()
  1190.         $(document).keyup(function (e) {
  1191.                 if (e.keyCode == 13) {
  1192.                             enterProcess()
  1193.                 }
  1194.         });
  1195.         loginFrameProcess();
  1196.         if (navigator.userAgent.indexOf("Firefox") >= 0) {
  1197.             if (document.getElementById("errorInfo_center").textContent != "") {
  1198.                 document.getElementById("errorInfo_hk").style.display = "block"
  1199.             }
  1200.         } else {
  1201.             if (document.getElementById("errorInfo_center").innerText != "") {
  1202.                 document.getElementById("errorInfo_hk").style.display = "block"
  1203.             }
  1204.         }
  1205.     try {
  1206.         autoLan();
  1207.         $("#username_tip").focus();
  1208.     } catch (f) {
  1209.     }
  1210.    
  1211. }
  1212. var services = [];
  1213. function loginFrameProcess() {
  1214.     var q = 35;
  1215.     var j = 33;
  1216.     var r = 180;
  1217.     var u = 50;
  1218.     var f = 42;
  1219.     var c = 1;
  1220.     var v = 5;
  1221.     var t = navigator.userAgent.toLowerCase();
  1222.         if ($("#username").attr("value") != "") {
  1223.             $("#username").show();
  1224.             $("#username_tip").hide();
  1225.            /* $("#username").focus();*/
  1226.         }
  1227.         if ($("#pwd").attr("value") == "") {
  1228.             $("#pwd").hide();
  1229.             $("#pwd_tip").show()
  1230.         }
  1231.         if($("#operatorPwd").attr("value")==""){
  1232.                                         $("#operatorPwd").hide();
  1233.                                         $("#operatorPwd_tip").show();
  1234.                 }
  1235.                          $("#operatorPwd_tip").focus(function(){
  1236.                                         $("#operatorPwd").attr("value","");
  1237.                                   $("#operatorPwd").show();
  1238.                                         $("#operatorPwd").focus();
  1239.                                         $("#operatorPwd_tip").hide();
  1240.                                         $("#serviceShowHide").hide();
  1241.                                  });
  1242.                                  $("#operatorPwd_tip").keypress(function(){
  1243.                                                  $("#operatorPwd").attr("value","");
  1244.                                     $("#operatorPwd").show();
  1245.                                     $("#operatorPwd").focus();
  1246.                                     $("#operatorPwd_tip").hide();
  1247.                                  });
  1248.                                  $("#operatorPwd").blur(function(){
  1249.                                          if ($("#operatorPwd").attr("value") == "") {
  1250.                                                  $("#operatorPwd").hide();
  1251.                                                  $("#operatorPwd_tip").show();
  1252.                                         }
  1253.                                  });
  1254.                                  
  1255.                       if($("#operatorUserId").attr("value")==""){
  1256.                                                 $("#operatorUserId").hide();
  1257.                                                 $("#operatorUserId_tip").show();
  1258.                         }
  1259.                                  $("#operatorUserId_tip").focus(function(){
  1260.                                                 $("#operatorUserId").attr("value","");
  1261.                                           $("#operatorUserId").show();
  1262.                                                 $("#operatorUserId").focus();
  1263.                                                 $("#operatorUserId_tip").hide();
  1264.                                                 $("#serviceShowHide").hide();
  1265.                                          });
  1266.                                          $("#operatorUserId_tip").keypress(function(){
  1267.                                                          $("#operatorUserId").attr("value","");
  1268.                                             $("#operatorUserId").show();
  1269.                                             $("#operatorUserId").focus();
  1270.                                             $("#operatorUserId_tip").hide();
  1271.                                          });
  1272.                                          $("#operatorUserId").blur(function(){
  1273.                                                  if ($("#operatorUserId").attr("value") == "") {
  1274.                                                          $("#operatorUserId").hide();
  1275.                                                          $("#operatorUserId_tip").show();
  1276.                                                 }
  1277.                                          });
  1278.                                  
  1279.                                  
  1280.                          if($("#validCode").attr("value")==""){
  1281.                                                 $("#validCode").hide();
  1282.                                                 $("#validCode_tip").show();
  1283.                                         }
  1284.                                  $("#validCode_tip").focus(function(){
  1285.                                                 $("#validCode").attr("value","");
  1286.                                           $("#validCode").show();
  1287.                                                 $("#validCode").focus();
  1288.                                                 $("#validCode_tip").hide();
  1289.                                                 $("#serviceShowHide").hide();
  1290.                                          });
  1291.                                          $("#validCode_tip").keypress(function(){
  1292.                                                          $("#validCode").attr("value","");
  1293.                                             $("#validCode").show();
  1294.                                             $("#validCode").focus();
  1295.                                             $("#validCode_tip").hide();
  1296.                                          });
  1297.                                          $("#validCode").blur(function(){
  1298.                                                  if ($("#validCode").attr("value") == "") {
  1299.                                                          $("#validCode").hide();
  1300.                                                          $("#validCode_tip").show();
  1301.                                                 }
  1302.                                          });
  1303.                                  var isfocus=false;
  1304.                                  var serviceJ = -1;
  1305.                          //服务获取焦点  打开服务列表
  1306.                                  $("#selectDisname").focus(function(){
  1307.                                                  if(typeflag=="true"&&$("#serviceShowHideTop").attr("show")!="true"){
  1308.                                                          //sam动态下发服务
  1309.                                                          $("#serviceShowHideTop").click();
  1310.                                                  }
  1311.                                                          //eportal后台配置服务
  1312.                                                          var _default_server=document.getElementById('net_access_type').value;
  1313.                                                                  for(var i=0;i<services.length;i++){
  1314.                                                                           var name =services[i].serviceName;
  1315.                                                                           var obj=document.getElementById("_service_"+i).parentNode.parentNode;
  1316.                                                                          if(name == _default_server){
  1317.                                                                                  serviceJ=i;
  1318.                                                                                  mOver(obj);
  1319.                                                                          }else{
  1320.                                                                                  mOut(obj);
  1321.                                                                          }
  1322.                                                                  }
  1323.                                                  isfocus=true;
  1324.                                                  if(typeflag=="true"&&$("#serviceShowHideTop").attr("show")!="true"){
  1325.                                                         
  1326.                                                  }else{
  1327.                                                          $("#serviceShowHide").show();
  1328.                                                  }
  1329.                                  });
  1330.                                  //服务框失去焦点
  1331.                                  $("#selectDisname").blur(function(){
  1332.                                          isfocus=false;
  1333.                                  });
  1334.         $("#loginLink").focus(function () {
  1335.             $("#serviceShowHide").hide();
  1336.             $("#serviceShowHideTop").attr("show", "false");
  1337.             $("#loginLink_div").css("background-position", "-373px -105px");
  1338.         });
  1339.         
  1340.         $(document).keydown(function(event){
  1341.                                          if(isfocus){
  1342.                                                         //方向键向上
  1343.                                                  if(event.keyCode == 38){
  1344.                                                          if(serviceJ == -1){
  1345.                                                                  serviceJ=0;
  1346.                                                          }else{
  1347.                                                                         if(serviceJ==0){
  1348.                                                                                 serviceJ=services.length-1;
  1349.                                                                          }else{
  1350.                                                                                  serviceJ=serviceJ-1;
  1351.                                                                          }
  1352.                                                          }
  1353.                                                  }
  1354.                                                  //方向键向下
  1355.                                                  if(event.keyCode == 40){
  1356.                                                          if(serviceJ==-1){
  1357.                                                                  serviceJ=0;
  1358.                                                          }else{
  1359.                                                                  if(serviceJ==services.length-1){
  1360.                                                                          serviceJ=0;
  1361.                                                                          }else{
  1362.                                                                                  serviceJ=serviceJ+1;
  1363.                                                                          }
  1364.                                                          }
  1365.                                                  }
  1366.                                                  var _serviceName,_serviceShowName;
  1367.                                                  for(var i=0;i<services.length;i++){
  1368.                                                          var name =services[i].serviceName;
  1369.                                                          var obj=document.getElementById("_service_"+i).parentNode.parentNode;
  1370.                                                          if(serviceJ==i){
  1371.                                                                  mOver(obj);
  1372.                                                                  _serviceName=name;
  1373.                                                                  _serviceShowName=services[i].serviceShowName;
  1374.                                                          }else{
  1375.                                                                  mOut(obj);
  1376.                                                          }
  1377.                                                  }
  1378.                                                  //使用空格选择服务
  1379.                                                  if(event.keyCode == 32){
  1380.                                                                  selectService(_serviceName,_serviceShowName,serviceJ);
  1381.                                                  }
  1382.                                          }
  1383.                                         });
  1384.    
  1385.             $("#serviceShowHideTop").click(function(){
  1386.                                  $("#errorInfo_hk").hide();//点击服务框时隐藏错误信息
  1387.                            try{
  1388.                                   if(typeflag=="true"&&$("#serviceShowHideTop").attr("show")!="true"){
  1389.                                           var username=$('#username').attr("value");
  1390.                                           if(username==""){
  1391.                                                   showerror("选择服务前请先输入用户名",1);
  1392.                                                   return;
  1393.                                           }
  1394.                                           var tj=document.getElementById("Tj_yes");
  1395.                         if (tj.style.display == "block" || tj.style.display == "") {
  1396.                                 username=prefixValue+username;
  1397.                         }
  1398.                                            var jsonTemp="";
  1399.                                                   try{
  1400.                                                           jsonTemp=decodeURIComponent(getCookie("servicesJsonStr"));
  1401.                                                   }catch(e2){
  1402.                                                          
  1403.                                                   }
  1404.                                           if(jsonTemp&&jsonTemp!=null&&jsonTemp!=""&&jsonTemp!="null"&&jsonTemp.length>0){
  1405.                                                            var tempBchs=jsonTemp.split("@%%username@%%");
  1406.                                                            if(tempBchs.length>1&&tempBchs[0]==username){
  1407.                                                                    serviceProcessForSecondGetByUserName(jsonTemp);
  1408.                                                                    return;
  1409.                                                            }
  1410.                                           }
  1411.                                           var url = "userV2.do?method=getServices";
  1412.                                           var search = window.location.search;
  1413.                                                 var data = {
  1414.                                                                 "username": username,
  1415.                                                                 "search": search
  1416.                                                 };
  1417.                                                 jQuery.getAjaxContent(url, data, serviceProcessForSecondGetByUserName);
  1418.                                                                                    
  1419.                                   }else{
  1420.                                                           if($("#serviceShowHideTop").attr("show")&& $("#serviceShowHideTop").attr("show")=="true"){
  1421.                                                                   $("#serviceShowHide").hide();
  1422.                                                                   $("#serviceShowHideTop").attr("show","false");
  1423.                                                           }else{
  1424.                                                                   $("#serviceShowHide").show();
  1425.                                                                   $("#serviceShowHideTop").attr("show","true");
  1426.                                                           }
  1427.                                   }
  1428.                          }catch(e){
  1429.                                  //alert(e);
  1430.                          }
  1431.     });
  1432.             try{
  1433.                                  var search_bch = window.location.search;
  1434.                                  var service_ace=false;
  1435.                                  if(search_bch.indexOf('&t=ace')!=-1){
  1436.                                          service_ace=true;
  1437.                                  }
  1438.                                  var serviceCookie = getCookie("EPORTAL_SERVICE_NAME");
  1439.                                  var serviceCookieShow = "";
  1440.                                  var showServiceCnt=0;
  1441.                                  var temp_bch={};
  1442.                                  for(var i=0;i<services.length;i++){
  1443.                                          var serviceName =services[i].serviceName;
  1444.                                          if(service_ace==true){
  1445.                                                  if(services[i].aceNotShow=='true'){
  1446.                                                          $("#bch_service_"+services[i].serviceName).hide();
  1447.                                                  }else{
  1448.                                                          temp_bch=services[i];
  1449.                                                          showServiceCnt=showServiceCnt+1;
  1450.                                                          if(serviceName==serviceCookie){
  1451.                                                                  serviceCookieShow=services[i].serviceShowName;
  1452.                                                          }
  1453.                                                  }
  1454.                                          }
  1455.                                  }
  1456.                                  if(showServiceCnt==1){
  1457.                                          serviceCookie=temp_bch.serviceName;
  1458.                                          serviceCookieShow=temp_bch.serviceShowName;
  1459.                                  }
  1460.                                  if(serviceCookie&&serviceCookieShow&&serviceCookie!=""&&serviceCookieShow!=""){
  1461.                                           $("#selectDisname").html(serviceCookieShow);
  1462.                                                 $("#net_access_type").attr("value",serviceCookie);
  1463.                                  }
  1464.                          }catch(e){
  1465.                                  
  1466.                          }
  1467.                          $("#loginFrame").show();
  1468.                          //点击首页其他地方隐藏服务下拉框
  1469.                                  var flag=true;
  1470.                                  $("#serviceShowHideTop").click(function(){
  1471.                                          flag=false;
  1472.                                  });
  1473.                                  $("#serviceShowHide").click(function(){
  1474.                                          flag=false;
  1475.                                  });
  1476.                                  $("#loginbody").click(function(){
  1477.                                          if(flag){
  1478.                                                  $("#serviceShowHide").hide();
  1479.                                          }
  1480.                                          flag=true;
  1481.                                  });
  1482. }

  1483. function enterProcess() {
  1484.         $("#loginLink").click()
  1485. }
  1486. function autoLan() {
  1487.     var a = getCookie("EPORTAL_AUTO_LAND");
  1488.     if ((a == "true" && getCookie("EPORTAL_COOKIE_USERNAME") != null && getCookie("EPORTAL_COOKIE_PASSWORD") != null) || (typeof(isAutoLand) != "undefined" && isAutoLand != "null" && isAutoLand != "")) {
  1489.             enterProcess()
  1490.     } else {
  1491.       
  1492.     }
  1493. }

  1494. var $serviceId = "";
  1495. function selectService(serviceName,serviceShowName,serviceNum){
  1496.                         if($serviceId!=""){
  1497.                                 $("#"+$serviceId).css({"background-color":"#FFFFFF","color":"#757575"});
  1498.                         }
  1499.                         $("#bch_service_"+serviceNum).css({"background-color":"#7ad79d","color":"#FFFFFF"});
  1500.                         $serviceId="bch_service_"+serviceNum;
  1501.                         $("#selectDisname").html(serviceShowName);
  1502.                         if(document.getElementById("isNoOperatorPasswordFrameId")){
  1503.                                 //判断是否是江苏电信服务..当前启用了江苏电信服务则显示运营商密码框
  1504.                                 var flag="";
  1505.                                 if(serviceName!="[-1-1]系统默认服务[-1-1]"){
  1506.                                         flag=document.getElementById("operatorPasswordFrame_"+serviceNum).value;
  1507.                                 }
  1508.                                 if(flag.indexOf("true")>-1)
  1509.                                 {
  1510.                                         if(document.getElementById("selectDisname").innerHTML &&
  1511.                                              document.getElementById("selectDisname").innerHTML!="" &&
  1512.                                              document.getElementById("selectDisname").innerHTML!="请选择服务"){
  1513.                                                         $("#operatorPwd_tip").attr("value","请输入"+document.getElementById("selectDisname").innerHTML+"对应的密码");
  1514.                                         }
  1515.                                         $("#isNoOperatorPasswordFrameId").show();
  1516.                                         $("#isNoOperatorPasswordFrameId_space").show();
  1517.                                 }else{
  1518.                                         var dx=dxServics;
  1519.                                         if(serviceName==dx&&dx!=""){
  1520.                                                 if(document.getElementById("selectDisname").innerHTML &&
  1521.                                                      document.getElementById("selectDisname").innerHTML!="" &&
  1522.                                                      document.getElementById("selectDisname").innerHTML!="请选择服务"){
  1523.                                                         $("#operatorPwd_tip").attr("value","请输入"+document.getElementById("selectDisname").innerHTML+"对应的密码");
  1524.                                                 }
  1525.                                                 $("#isNoOperatorPasswordFrameId_space").show();
  1526.                                                 $("#isNoOperatorPasswordFrameId").show();
  1527.                                         }else{
  1528.                                                 $("#isNoOperatorPasswordFrameId").hide();
  1529.                                                 $("#isNoOperatorPasswordFrameId_space").hide();
  1530.                                                 $("#isNoOperatorUserIdFrameId").hide();
  1531.                                                 $("#isNoOperatorUserIdFrameId_space").hide();
  1532.                                         }
  1533.                                 }
  1534.                         }
  1535.                         if(document.getElementById("isNoDomainName")){
  1536.                                 $("#isNoDomainName").attr("value",$("#domainName"+serviceNum).val());
  1537.                                 setCookies("EPORTAL_COOKIE_DOMAIN", $("#domainName"+serviceNum).val());
  1538.                         }else{
  1539.                                         setCookies("EPORTAL_COOKIE_DOMAIN", "");
  1540.                         }
  1541.                
  1542.                 $("#net_access_type").attr("value",serviceName);
  1543.                 $("#serviceShowHide").hide();
  1544.                 $("#serviceShowHideTop").attr("show","false");
  1545.                 hideErrorTipImage();
  1546. }
  1547. //隐藏错误图片
  1548. function hideErrorTipImage(){
  1549.         $("#isUsernameErrorImg").hide();
  1550.         $("#isPwdErrorImg").hide();
  1551.         $("#isServiceErrorImg").hide();
  1552.         $("#isOperatorPwdErrorImg").hide();
  1553.         $("#isValidCodeErrorImg").hide();
  1554. }
  1555. function mOver(a) {
  1556.         if (a.id == $serviceId) {
  1557.             return
  1558.         }
  1559.         $(a).css("background-color", "#e0f1e5")
  1560. }
  1561. function mOut(a) {
  1562.         if (a.id == $serviceId) {
  1563.             return
  1564.         }
  1565.         $(a).css("background-color", "#FFFFFF")
  1566. }

  1567. function serviceProcessForSecondGetByUserName(jsonTemp){
  1568.          if(jsonTemp==null||jsonTemp==""||jsonTemp=="null"){
  1569.                  var labelHtml="";
  1570.                  var label="系统默认服务";
  1571.                  var labelValue="[-1-1]系统默认服务[-1-1]";
  1572.                  labelHtml=labelHtml +"<div id='bch_service_"+labelValue+"' class="login_frame_hang" onmouseover="mOver(this)" onmouseout="mOut(this)" onclick="selectService('"+labelValue+"','"+label+"','"+0+"')"><div class="left_right_input">         <div id="service_detail_left" class="left"></div>          <div class="right" id='_service_"+0+"'>"+label+"                </div></div></div>";
  1573.                  $("#serviceContent").html(labelHtml);
  1574.          }else{
  1575.                  var jsonStr="";
  1576.                  var tempBchs=jsonTemp.split("@%%username@%%");
  1577.                  if(tempBchs.length>1){
  1578.                          jsonTemp=tempBchs[1];
  1579.                  }
  1580.                  var username=$('#username').attr("value");
  1581.                  try{
  1582.                          setCookies("servicesJsonStr",username+"@%%username@%%"+jsonTemp);
  1583.                  }catch(e){
  1584.                          //alert(e);
  1585.                  }
  1586.                  var serviceFormats=jsonTemp.split("@");
  1587.                  for(var i=0;i<serviceFormats.length;i++){
  1588.                          var serviceFormat='{"aceNotShow":"false","serviceDefault":"false","serviceName":"5555","serviceShowName":"5555"}';
  1589.                          jsonStr=jsonStr+serviceFormat.replace(/5555/g, serviceFormats[i])+",";
  1590.                  }
  1591.                  if(jsonStr.length>0){
  1592.                          jsonStr=jsonStr.substring(0,jsonStr.length-1);
  1593.                          jsonStr="["+jsonStr+"]";
  1594.                  }
  1595.                  services=jQuery.parseJSON(jsonStr);
  1596.                  var labelHtml="";
  1597.                  var cc=1;
  1598.                  if(dxServics.indexOf("%")>0){
  1599.                          if($("#isNoOperatorPasswordFrameId")&&dxServics!=''){
  1600.                                  dxServics=dxServics.split("%");
  1601.                                  cc=2;
  1602.                          }
  1603.                  }
  1604.                  for(var i=0;i<services.length;i++){
  1605.                          var label=services[i].serviceShowName;
  1606.                          var labelValue=services[i].serviceName;
  1607.                          var dxFlag=false;
  1608.                          if(cc==2){
  1609.                                  if(dxServics&&dxServics.length>=1){
  1610.                                          for(var tt=0;tt<dxServics.length;tt++){
  1611.                                                  if(dxServics[i]==labelValue){
  1612.                                                          dxFlag=true;
  1613.                                                  }
  1614.                                          }
  1615.                                  }
  1616.                          }else{
  1617.                                          if(dxServics&&dxServics!=''){
  1618.                                                  if(dxServics==labelValue){
  1619.                                                          dxFlag=true;
  1620.                                                  }
  1621.                                  }
  1622.                          }
  1623.                          labelHtml=labelHtml +"<div id='bch_service_"+i+"' class="login_frame_hang" onmouseover="mOver(this)" onmouseout="mOut(this)" onclick="selectService('"+labelValue+"','"+label+"','"+i+"')"><div class="left_right_input">         <div id="service_detail_left" class="left"></div>          <div class="right" id='_service_"+i+"'>"+label+"                </div>";
  1624.                         //为了解决选择服务的js
  1625.                          labelHtml=labelHtml +"<input id='operatorPasswordFrame_"+i+"' type="hidden" value='"+dxFlag+"'>";
  1626.                          labelHtml=labelHtml +"</input></div></div>";
  1627.                  }
  1628.                  $("#serviceContent").html(labelHtml);
  1629.           }
  1630.                  if($("#serviceShowHideTop").attr("show")&& $("#serviceShowHideTop").attr("show")=="true"){
  1631.                   $("#serviceShowHide").hide();
  1632.                   $("#serviceShowHideTop").attr("show","false");
  1633.           }else{
  1634.                   $("#serviceShowHide").show();
  1635.                   $("#serviceShowHideTop").attr("show","true");
  1636.           }
  1637. }

  1638. function closeSubPage() {
  1639.           $("#tipframe").hide();
  1640.           window.parent.document.getElementById("divPop").style.display = 'none';
  1641.           window.parent.document.getElementById("divTupian").style.display = 'none';
  1642.           window.parent.document.getElementById("divTupian3").style.display = 'none';
  1643.           window.parent.document.getElementById("divMask").style.display = 'none';
  1644. }

  1645. function opensetting() {
  1646.   $("#tipframe").show();//ie高版本不支持div遮罩--临时使用此实现效果
  1647.   window.parent.document.getElementById("divMask").style.height = window.parent.document.body.scrollHeight;
  1648.   //显示遮罩
  1649.   window.parent.document.getElementById("divMask").style.display = 'block';
  1650.   window.parent.document.getElementById("divPop").style.display = 'block';
  1651.   window.parent.document.getElementById("divTupian").style.display = 'block';
  1652.   window.parent.document.getElementById("divTupian3").style.display = 'block';
  1653.   window.top.scrollTo(0, 0);
  1654.   $("#appDownDiv").hide();
  1655.   $("#settingDiv").show();
  1656.   $("#subPageUrl_chongzhi").hide();
  1657. }

  1658. function openAppdown(){
  1659.   $("#tipframe").show();//ie高版本不支持div遮罩--临时使用此实现效果
  1660.   window.parent.document.getElementById("divMask").style.height = window.parent.document.body.scrollHeight;
  1661.   //显示遮罩
  1662.   window.parent.document.getElementById("divMask").style.display = 'block';
  1663.   window.parent.document.getElementById("divPop").style.display = 'block';
  1664.   window.parent.document.getElementById("divTupian").style.display = 'block';
  1665.   window.parent.document.getElementById("divTupian3").style.display = 'block';
  1666.   window.top.scrollTo(0, 0);
  1667.   $("#settingDiv").hide();
  1668.   $("#appDownDiv").show();
  1669.   $("#subPageUrl_chongzhi").hide();
  1670. }
复制代码



这是第二个代码文件:
  1. var AuthInterFace = (function() {
  2.         var ePortalUrl = "";
  3.         function post(url, data,callback) {
  4.                 var thePost = (window.XMLHttpRequest) ? new XMLHttpRequest() : new ActiveXObject("Microsoft.XMLHTTP");
  5.                 thePost.open("POST", url, true);
  6.                 thePost.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
  7.                 thePost.onreadystatechange=function() {
  8.                         if (thePost.readyState == 4 && thePost.status == 200) {
  9.                                 if(thePost.responseText&&thePost.responseText!=""){
  10.                                         if(callback){
  11.                                                 callback(eval("("+thePost.responseText+")"));
  12.                                         }
  13.                                 }
  14.                         }
  15.                 }
  16.                 thePost.send(data);
  17.         }
  18.         return {
  19.                 init:function(url){
  20.                         ePortalUrl=url + "InterFace.do?method=";
  21.                 },
  22.                 login : function(userId, password, service, queryString,operatorPwd,operatorUserId,validcode,callback) {
  23.                         /* 1.登录 */
  24.                 //密码是否加密
  25.                          var passwordEncrypt = encodeURIComponent(encodeURIComponent(document.getElementById("passwordEncrypt").value));
  26.                          if(passwordEncrypt&&passwordEncrypt=="true"){
  27.                                          setMaxDigits(130);
  28.                                          var key = new RSAKeyPair("10001","","9c2899b8ceddf9beafad2db8e431884a79fd9b9c881e459c0e1963984779d6612222cee814593cc458845bbba42b2d3474c10b9d31ed84f256c6e3a1c795e68e18585b84650076f122e763289a4bcb0de08762c3ceb591ec44d764a69817318fbce09d6ecb0364111f6f38e90dc44ca89745395a17483a778f1cc8dc990d87c3");
  29.                                          password = encryptedString(key, password);
  30.                                          if(undefined!=operatorPwd &&null!=operatorPwd && ''!=operatorPwd){
  31.                                                  operatorPwd = encryptedString(key, operatorPwd);
  32.                                          }
  33.                          }
  34.                         var content = "userId=" + userId + "&password=" + password + "&service=" + service + "&queryString=" + queryString+"&operatorPwd="+operatorPwd+"&operatorUserId="+operatorUserId+"&validcode="+validcode+"&passwordEncrypt="+passwordEncrypt;
  35.                         //var content = "userId=" + userId + "&password=" + password + "&service=" + service + "&queryString=" + queryString+"&operatorPwd="+operatorPwd+"&operatorUserId="+operatorUserId+"&validcode="+validcode;
  36.                         post(ePortalUrl + "login", content, callback);
  37.                 },
  38.                 keepalive : function(userIndex,callback) {
  39.                         /* 2.保活 */
  40.                         var content = "userIndex=" + userIndex;
  41.                         post(ePortalUrl + "keepalive", content,callback);
  42.                 },
  43.                 getOnlineUserInfo : function(userIndex,callback) {
  44.                         /* 3.获取在线用户信息 */
  45.                         var content = "userIndex=" + userIndex;
  46.                         post(ePortalUrl + "getOnlineUserInfo", content,callback);
  47.                 },
  48.                 freshOnlineUserInfo : function(userIndex,callback) {
  49.                         var content = "userIndex=" + userIndex;
  50.                         post(ePortalUrl + "freshOnlineUserInfo", content,callback);
  51.                 },
  52.                 logout : function(userIndex,callback) {
  53.                         /* 4.下线 */
  54.                         var content = "userIndex=" + userIndex;
  55.                         post(ePortalUrl + "logout", content,callback);
  56.                 },
  57.                 loginWithQrCode : function(qrCode, queryString,callback) {
  58.                         /* 5.二维码认证 */
  59.                         var content = "qrCode=" + qrCode + "&queryString=" + queryString;
  60.                         post(ePortalUrl + "loginWithQrCode", content,callback);
  61.                 },
  62.                 visitorReg : function(phoneNum, authCode,validcode,callback) {
  63.                         /* 6.访客注册 */
  64.                         var content = "phoneNum=" + phoneNum + "&authCode=" + authCode+"&validcode="+validcode;
  65.                         post(ePortalUrl + "visitorReg", content,callback);
  66.                 },
  67.                 pageInfo : function(queryString,callback) {
  68.                         /* 7.获取页面显示信息 */
  69.                         var content = "queryString=" + queryString;
  70.                         post(ePortalUrl + "pageInfo", content,callback);
  71.                 },
  72.                 registerMac : function(mac, userIndex,callback) {
  73.                         /* 8.注册MAC快速认证 */
  74.                         var content = "mac=" + mac + "&userIndex=" + userIndex;
  75.                         post(ePortalUrl + "registerMac", content,callback);
  76.                 },
  77.                 cancelMac : function(mac, userIndex,callback) {
  78.                         /* 9.取消MAC快速认证 */
  79.                         var content = "mac=" + mac + "&userIndex=" + userIndex;
  80.                         post(ePortalUrl + "cancelMac", content,callback);
  81.                 },
  82.                 cancelMacWithUserNameAndMac : function(userId, mac,callback) {
  83.                         /* 9.取消MAC快速认证 */
  84.                         var content = "userId=" + userId + "&usermac=" + mac;
  85.                         post(ePortalUrl + "cancelMacWithUserNameAndMac", content,callback);
  86.                 },
  87.                         /*10.使用用户名密码下线所有用户*/
  88.                 logoutByUserIdAndPass:function (userId,pass,callback){
  89.                         var content = "userId=" + userId + "&pass=" + pass;
  90.                         post(ePortalUrl + "logoutByUserIdAndPass", content,callback);
  91.                 },
  92.                 /*11.切换服务*/
  93.                 switchService:function (userIndex,serviceName,callback){
  94.                         var content = "userIndex=" + userIndex + "&serviceName=" + serviceName;
  95.                         post(ePortalUrl + "switchService", content,callback);
  96.                 },
  97.                 //获取服务
  98.                 getServices:function(queryString,callback){
  99.                         post(ePortalUrl+"getServices" + "&queryString=" + queryString,'',callback);
  100.                 },
  101.                 registerNetWorkProtocol:function(userId,callback){
  102.                         var content = "userId=" + userId;
  103.                         post(ePortalUrl+"registerNetWorkProtocol",content,callback);
  104.                 },
  105.                 validateUserName:function(userId,userName,callback){
  106.                         var content = "userId=" + userId+"&userName="+userName;
  107.                         post(ePortalUrl+"validateUserName",content,callback);
  108.                 },
  109.                 modifyPass:function(userId,pass,callback){
  110.                         var content = "userId=" + userId+"&pass="+pass;
  111.                         post(ePortalUrl+"modifyPass",content,callback);
  112.                 }
  113.         };
  114. })();
复制代码

想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

发表于 2020-8-31 20:30:36 | 显示全部楼层
这么长!?!?!?
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

 楼主| 发表于 2020-8-31 20:37:05 | 显示全部楼层
哈哈哈  下载下来的  没学过JavaScript  看不懂  但求破解方法
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

发表于 2020-9-1 20:50:19 | 显示全部楼层
看起来好像是网络认证的一部分,你这个是干嘛,要强行破入吗?
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

发表于 2020-9-2 07:31:48 | 显示全部楼层
This is javascript not java!

点评

我很赞同!: 5.0
我很赞同!: 5
  发表于 2020-9-2 13:08
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

发表于 2020-9-2 09:47:06 | 显示全部楼层
只怕是要直接强破啊
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

发表于 2020-9-3 09:17:50 | 显示全部楼层
老实交网费吧
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

发表于 2020-9-5 19:08:20 | 显示全部楼层
kali吧
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2024-4-25 12:42

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表