PageSourceSearch

http://www.houdask.com/site/hd/resources/js/indexfun.js

js houdask.com collected 2026-10-02 06:29:23 UTC 8,342 bytes, 234 lines download raw bytes

1var webInfo=jumpId("webInfo");
2if(!webInfo){
3    if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)){
4        window.location.href = "https://www.fakaopx.com/";
5    }
6}
7//cms路径跳转www
8var allUrl=window.location.href;
9if(allUrl.indexOf("cms.") !== -1){
10    window.location.replace("http://www.houdask.com")
11}
12
13window.baseUrl="http://"+document.domain+"/";//测试环境=>正式环境需要删除:8088
14window.siteUrl=window.baseUrl+"site/hd/";
15window.thirdUrl=window.baseUrl;//第三方登录使用
16window.apiPath=window.baseUrl;
17
18//定义接口路径变量名
19var bookAjax=window.apiPath+"api";
20var freeAjax=window.apiPath+"api";
21var perAjax=window.apiPath+"api";
22var urlAjax=window.baseUrl;
23
24
25/*添加百度统计*/
26var _hmt = _hmt || [];
27(function() {
28    var hm = document.createElement("script");
29    hm.src = "https://hm.baidu.com/hm.js?025656ffc846b7a1beef6de5f4d07596";
30    var s = document.getElementsByTagName("script")[0];
31    s.parentNode.insertBefore(hm, s);
32})();
33/*添加百度抓取*/
34(function(){
35    var bp = document.createElement('script');
36    var curProtocol = window.location.protocol.split(':')[0];
37    if (curProtocol === 'https'){
38        bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
39    }else{
40        bp.src = 'http://push.zhanzhang.baidu.com/push.js';
41    }
42    var sc = document.getElementsByTagName("script")[0];
43    sc.parentNode.insertBefore(bp, sc);
44})();
45
46var BaiduTongJi = {
47    visitPage : function (_path)
48    {
49        _hmt.push(['_trackPageview', _path]);
50    }
51};
52/* 检查ie浏览器版本 */
53(function() {
54  var o = navigator.userAgent.match(/MSIE (\d+)/);
55  o = o && o[1];
56  // ie9 以下 || o != null
57  if (!!o && o < 9) {
58    // 更新页面
59    var newUrl ='/site/hd/resources/views/home/compatibility.html';
60    location.href =  newUrl;
61  }
62})();
63
64//获取router地址栏传参
65function routerName(name) {
66    var url = window.location.hash;
67    var urlStr = url.substr(url.lastIndexOf("?"));
68    var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)');
69    var path = urlStr.substr(1).match(reg);
70    if (path != null) {
71        return decodeURI(path[2]);
72    }
73    return null;
74}
75
76//获取地址栏传参
77function jumpId(name) {
78    var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)');
79    var path = window.location.search.substr(1).match(reg);
80    if (path != null) {
81        return decodeURI(path[2]);
82    }
83    return null;
84}
85
86//删除cookie值
87function DelCookie(name){   
88    var exp = new Date();   
89    exp.setTime(exp.getTime() - 1);   
90    var cval=GetCookie(name);   
91    if(cval!=null)document.cookie= name + "="+cval+"; path=/;expires="+exp.toGMTString();   
92}
93//获取cookie值
94function GetCookie(name){   
95    var arr, reg = new RegExp("(^| )"+name+"=([^;]*)(;|$)");  
96    if(arr=document.cookie.match(reg)){
97        return unescape(arr[2]);   
98    }else{  
99        return null;   
100    }
101}
102//全局用户信息本地缓存
103$.ajax({
104    url:"/api/sys/success",
105    type:"POST",
106    dataType:"json",
107    success:function(msg){
108        if(msg.code==1){
109            var dataInfo=msg.data;
110            if(dataInfo==undefined){
111                $.ajax({//退出
112                    url:"/api/sys/anon/logout",
113                    dataType:"json",
114                    type:"POST",
115                    success:function(data){}
116                })
117                return;
118            }
119            var phoneData=dataInfo.userName;
120            var ncName=dataInfo.ncName;
121            if(phoneData==undefined || phoneData==""){
122                $.ajax({//退出
123                    url:"/api/sys/anon/logout",
124                    dataType:"json",
125                    type:"POST",
126                    success:function(data){}
127                })
128                sessionStorage.removeItem("userID");
129                $("#login").show();
130                $("#username").hide();
131                DelCookie("deviceId");//删除单点登录code
132            }else{
133                var Getdevice=GetCookie("deviceId");
134                if(Getdevice==null && Getdevice=="" && Getdevice==undefined){
135                    $.ajax({
136                        url:"/api/sys/anon/logout",
137                        dataType:"json",
138                        type:"POST",
139                        success:function(data){
140                            if(data.code=="1"){
141                                sessionStorage.removeItem("userID");
142                                DelCookie("deviceId");//删除单点登录code
143                                $("#login").show();
144                                $("#username").hide();
145                                location.href="/site/hd/index.html?login=false";
146                            }
147                        }
148                    })
149                }else{
150                    $.ajax({
151                        url:"/api/sys/anon/get/user/deviceId",
152                        type:"POST",
153                        dataType:"json",
154                        headers:{
155                            "appType":"WEB"
156                        },
157                        success:function(msg){
158                            if(msg.code==1){
159                                var data=msg.data.deviceId;
160                                if(Getdevice!=data){
161                                    $.ajax({//退出
162                                        url:"/api/sys/anon/logout",
163                                        dataType:"json",
164                                        type:"POST",
165                                        success:function(data){}
166                                    })
167                                    sessionStorage.removeItem("userID");
168                                    $("#login").show();
169                                    $("#username").hide();
170                                    DelCookie("deviceId");//删除单点登录code
171                                    sessionStorage.removeItem("userID");
172                                    location.href="/site/hd/index.html?login=false";
173                                    alert("您已在别的设备登录!");
174                                }else{
175                                    sessionStorage.setItem("userID",JSON.stringify(dataInfo));
176                                    $("#login").hide();
177                                    $("#username").show();
178                                    $(".yesLogin .homePerson img").attr("src",dataInfo.loadImage);
179                                    $(".yesLogin .homePerson p").html(dataInfo.ncName);
180                                }
181                            }
182                        }
183                    })
184                } 
185            }
186        }else{
187            sessionStorage.removeItem("userID");
188            $("#login").show();
189            $("#username").hide();
190        }
191    }
192})
193
194//主客观考试倒计时
195$.ajax({
196    url:"/api/other/examinecountdown/anon/pc/get/new",
197    dataType:"json",
198    type:"POST",
199    success:function(res){
200        if(res.code==1){
201            var examTime=res.data.examTimeList;
202            $(".examTime").html('<div class="keExamTime">'+
203                                    '<p>距离<br>'+examTime[0].text+'</p>'+
204                                    '<span><strong>'+examTime[0].examTime+'</strong>天</span>'+
205                                '</div>'+
206                                '<div class="line"></div>'+
207                                '<div class="zhuExamTime">'+
208                                    '<p>距离<br>'+examTime[1].text+'</p>'+
209                                    '<span><strong>'+examTime[1].examTime+'</strong>天</span>'+
210                                '</div>');
211        }
212    }
213})
214
215//获取后台手机正则验证码
216$.ajax({
217    url:"/api/sp/config/spDicConfig/anon/getDataUpdate",
218    dataType:"json",
219    type:"POST",
220    data:{
221        "type":"regularPhone"
222    },
223    success:function(msg){
224        if(msg.code==1){
225            localStorage.setItem("phone",msg.data.regularPhone);
226        }
227    }
228})
229
230//是否未登录弹框
231var isLogin=jumpId("login");
232if(isLogin=='false'){
233    $(".loginWrap").show();
234}

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