1//ç¹å»æ¾ç¤ºç»éå¼¹æ¡ 2$("#login>span,.LOGIN").click(function(){ 3 $(".loginWrap").show(); 4}) 5//ç¹å»æ¾ç¤ºå¿è®°å¯ç å¼¹æ¡ 6$("#showForget").click(function(){ 7 $(".forgetWrap").show(); 8 $(".loginWrap").hide(); 9}) 10//å»å¦ä¹ ï¼ä¸ªäººä¸å¿ï¼ 11$("#username>span,.goPerson").click(function(){ 12 location.href="/site/personal/personal.html"; 13}) 14//è´¦å·å¯ç ç»å½åè½ 15//è·åcookieå¼ 16function GetCookie(name){ 17 var arr, reg = new RegExp("(^| )"+name+"=([^;]*)(;|$)"); 18 if(arr=document.cookie.match(reg)){ 19 return unescape(arr[2]); 20 }else{ 21 return null; 22 } 23} 24//设置cookieå¼ 25function SetCookie(name,value){ 26 //document.cookie.setPath("/"); 27 var exp = new Date(); 28 exp.setTime(exp.getTime() + 1000*60*60*24*365*10); 29 document.cookie = name + "="+ escape (value) + ";expires=" + exp.toGMTString()+";path=/"; 30} 31//å é¤cookieå¼ 32function DelCookie(name){ 33 var exp = new Date(); 34 exp.setTime(exp.getTime() - 1); 35 var cval=GetCookie(name); 36 if(cval!=null)document.cookie= name + "="+cval+"; path=/;expires="+exp.toGMTString(); 37} 38$(".homeLoginClose").click(function(){ 39 $(".loginWrap,.forgetWrap").hide(); 40}) 41//忢ç»å½æ¹å¼ 42$(".loginType span").click(function(){ 43 var idx=$(this).index(); 44 $(this).addClass("active").siblings("span").removeClass("active"); 45 $(".loginCen>div").eq(idx).show().siblings().hide(); 46}) 47//åå¨åç¹ç»å½code 48function device(){ 49 var deviceId=new Date().getTime(); 50 var deviceData={ 51 "deviceId":deviceId 52 } 53 $.ajax({
54 url:"/api/sys/login/sendDownlineMessage", 55 type:"POST", 56 dataType:"json", 57 async: false, 58 headers:{ 59 "appType":"WEB" 60 }, 61 data:{ 62 "data":JSON.stringify(deviceData) 63 }, 64 success:function(msg){ 65 if(msg.code=="1"){ 66 SetCookie("deviceId",deviceId); 67 } 68 }, 69 error:function(){ 70 $.ajax({ 71 url:"/api/sys/login/sendDownlineMessage", 72 type:"POST", 73 dataType:"json", 74 async: false, 75 headers:{ 76 "appType":"WEB" 77 }, 78 data:{ 79 "data":JSON.stringify(deviceData) 80 }, 81 success:function(msg){ 82 if(msg.code=="1"){ 83 SetCookie("deviceId",deviceId); 84 } 85 } 86 }) 87 } 88 }) 89} 90$("#btn_login").click(function(){//ç»é 91 var type=$(".loginType .active").attr("data-type"); 92 if(type==1){//1éªè¯ç 2å¯ç 93 yzLogin(); 94 }else{ 95 mmLogin(); 96 } 97}); 98 99//å¯ç ç»å½ 100function mmLogin(){ 101 var reg=new RegExp(localStorage.getItem("phone")); 102 var username=$("#loginPhone").val(); 103 if(!reg.test(username)){ 104 layer.msg("请è¾å ¥æ£ç¡®çææºå·"); 105 return; 106 } 107 if(!$("#password").val()){ 108 layer.msg("请è¾å ¥å¯ç "); 109 return; 110 } 111 if(!$("#loginAgree").prop("checked")){ 112 layer.msg("æªåæç¨æ·æå¡æ¡æ¬¾"); 113 return; 114 } 115 var data={ 116 "loginWay":"WEB",//ç³»ç»ç±»å 117 "regWayId":"SJ",//ææºå·ç»é 118 "userName":username,//ææºå· 119 "password":hex_md5($("#password").val())//å¯ç 120 } 121 $.ajax({
122 url:"/api/sys/login/authc", 123 type:"POST", 124 dataType:"json", 125 headers:{ 126 "appType":"WEB" 127 }, 128 data:{ 129 "data":JSON.stringify(data) 130 }, 131 success:function(msg){ 132 if(msg.code=="1"){ 133 var userID=msg.data; 134 //忬å°åå¨ç¨æ·ä¿¡æ¯ 135 sessionStorage.setItem("userID",JSON.stringify(userID)); 136 $("#login").hide(); 137 $("#username").show(); 138 //åç¹ç»å½ 139 device(); 140 location.href="/site/hd/resources/views/home/jump.html?text=ç»éæå"; 141 }else{ 142 layer.msg(msg.message); 143 } 144 } 145 }) 146} 147//éªè¯ç ç»å½ 148function yzLogin(){ 149 var reg=new RegExp(localStorage.getItem("phone")); 150 var username=$("#loginPhone1").val(); 151 var loginCode=$("#loginCode").val(); 152 if(!reg.test(username)){ 153 layer.msg("请è¾å ¥æ£ç¡®çææºå·"); 154 return; 155 } 156 if(!loginCode){ 157 layer.msg("请è¾å ¥éªè¯ç "); 158 return; 159 } 160 if(!$("#loginAgree").prop("checked")){ 161 layer.msg("æªåæç¨æ·æå¡æ¡æ¬¾"); 162 return; 163 } 164 var data={ 165 "loginWay":"WEB",//ç³»ç»ç±»å 166 "regWayId":"SJ",//ææºå·ç»é 167 "userName":username,//ææºå· 168 "code":loginCode//çä¿¡éªè¯ç 169 } 170 $.ajax({
171 url:"/api/sys/anon/phone/code/login", 172 dataType:"json", 173 type:"POST", 174 headers:{ 175 "appType":"WEB" 176 }, 177 data:{ 178 "data":JSON.stringify(data) 179 }, 180 success:function(res){ 181 if(res.code=="1"){ 182 var userID=res.data; 183 //忬å°åå¨ç¨æ·ä¿¡æ¯ 184 sessionStorage.setItem("userID",JSON.stringify(userID)); 185 $("#login").hide(); 186 $("#username").show(); 187 //åç¹ç»å½ 188 device(); 189 location.href="/site/hd/resources/views/home/jump.html?text=ç»éæå"; 190 }else{ 191 layer.msg(res.message); 192 } 193 } 194 }) 195} 196 197//éåºç»é 198$(".exit").click(function(){ 199 $.ajax({ 200 url:"/api/sys/anon/logout", 201 dataType:"json", 202 type:"POST", 203 success:function(data){ 204 if(data.code=="1"){ 205 sessionStorage.removeItem("userID"); 206 sessionStorage.removeItem("zxPlay");//å é¤ç´æè·¯å¾ 207 DelCookie("deviceId");//å é¤åç¹ç»å½code 208 location.href="/site/hd/index.html"; 209 } 210 } 211 }) 212}) 213 214 215/*éªè¯ç ç»å½*/ 216function getValidation(code){ 217 var data={ 218 "mobile":$("#loginPhone1").val(), 219 "type":"LOGIN", 220 } 221 $.ajax({
222 url:"/api/sys/anon/v3/phone/code", 223 type:"POST", 224 dataType:"json", 225 headers:{ 226 appType:"WEB", 227 captchaCode:code, 228 type:"login" 229 }, 230 data:{ 231 "data":JSON.stringify(data) 232 }, 233 success:function(data){ 234 if(data.code==1){ 235 var num=60; 236 var timer=setInterval(function(){ 237 num-- 238 if(num<=0){ 239 $("#getCode").html("è·åéªè¯ç "); 240 clearInterval(timer); 241 $("#getCode").attr("disabled",false); 242 }else{ 243 $("#getCode").html(num+"s"); 244 $("#getCode").attr("disabled",true); 245 } 246 },1000) 247 }else{ 248 layer.msg(data.message); 249 } 250 } 251 }) 252} 253// åå§åéªè¯ç å¼¹åºå¼ 254$('#mpanel').slideVerify({ 255 baseUrl:'/api/sys/anon', //æå¡å¨è¯·æ±å°å 256 containerId:'getCode', // popæ¨¡å¼ å¿ å¡« 被ç¹å»ä¹ååºç°è¡ä¸ºéªè¯ç çå ç´ id 257 mode:'pop', 258 imgSize : { //å¾çç大å°å¯¹è±¡ 259 width: '400px', 260 height: '200px', 261 }, 262 beforeCheck:function(){ //æ£éªåæ°åæ³æ§ç彿° mode ="pop"ææ 263 var flag = true; 264 //å®ç°: åæ°åæ³æ§ç夿é»è¾, è¿åä¸ä¸ªbooleanå¼ 265 return flag 266 }, 267 ready : function() { 268 }, 269 success : function(params) { 270 //è¿åçäºæ¬¡éªè¯åæ° åå¹¶å°éªè¯éè¿ä¹åçé»è¾ åæ°ä¸åä¼ æå¡å¨ 271 getValidation(params.captchaVerification); 272 }, 273 error : function() { 274 } 275}); 276 277//å¿è®°å¯ç 278//è·åéªè¯ç 279function forgetCode(code){ 280 var phone=$(".forgetPhone").val(); 281 var reg=new RegExp(localStorage.getItem("phone")); 282 if(!reg.test(phone)){ 283 layer.msg("请è¾å ¥æ£ç¡®çææºå·"); 284 }else{ 285 var data={ 286 "mobile":phone, 287 "type":"RESET" 288 } 289 $.ajax({
290 type:"POST", 291 dataType:"json", 292 url:"/api/sys/anon/v3/phone/code", 293 headers:{ 294 appType:"WEB", 295 captchaCode:code, 296 type:"fogetPwd" 297 }, 298 data:{ 299 "data":JSON.stringify(data) 300 }, 301 success:function(msg){ 302 if(msg.code==1){ 303 var num=60; 304 var timer=setInterval(function(){ 305 num-- 306 if(num<=0){ 307 $("#forgetCode").html("è·åéªè¯ç "); 308 clearInterval(timer); 309 $("#forgetCode").attr("disabled",false); 310 }else{ 311 $("#forgetCode").html(num+"s"); 312 $("#forgetCode").attr("disabled",true); 313 } 314 },1000) 315 }else{ 316 layer.msg(msg.message); 317 } 318 } 319 }) 320 } 321} 322$('#forgetMpanel').slideVerify({ 323 baseUrl:'/api/sys/anon', //æå¡å¨è¯·æ±å°å, é»è®¤å°å为å®åæå¡å¨; 324 containerId:'forgetCode', // popæ¨¡å¼ å¿ å¡« 被ç¹å»ä¹ååºç°è¡ä¸ºéªè¯ç çå ç´ id 325 mode:'pop', 326 imgSize : { //å¾çç大å°å¯¹è±¡ 327 width: '400px', 328 height: '200px', 329 }, 330 beforeCheck:function(){ //æ£éªåæ°åæ³æ§ç彿° mode ="pop"ææ 331 var flag = true; 332 //å®ç°: åæ°åæ³æ§ç夿é»è¾, è¿åä¸ä¸ªbooleanå¼ 333 return flag 334 }, 335 ready : function() { 336 }, 337 success : function(params) { 338 //è¿åçäºæ¬¡éªè¯åæ° åå¹¶å°éªè¯éè¿ä¹åçé»è¾ åæ°ä¸åä¼ æå¡å¨ 339 forgetCode(params.captchaVerification); 340 }, 341 error : function() { 342 } 343}); 344 345//æäº¤ 346$("#forgetSubmit").click(function(){ 347 var forgetPhone=$(".forgetPhone").val(); 348 var newPassword=$(".newPassword").val(); 349 var oldPassword=$(".oldPassword").val(); 350 var forgetCode=$(".forgetCodeTxt").val(); 351 if(!forgetPhone){ 352 layer.msg("请è¾å ¥ææºå·"); 353 return; 354 } 355 if(!forgetCode){ 356 layer.msg("请è¾å ¥éªè¯ç "); 357 return; 358 } 359 if(newPassword.length<6){ 360 layer.msg("å¯ç æå°6个å符"); 361 return; 362 } 363 if(newPassword!=oldPassword){ 364 layer.msg("请è¾å ¥ä¸è´çå¯ç "); 365 return; 366 } 367 var data={ 368 "userName":forgetPhone, 369 "password":hex_md5(newPassword), 370 "code":forgetCode 371 } 372 $.ajax({
373 type:"POST", 374 dataType:"json", 375 url:"/api/sys/anon/user/reset/pwd", 376 data:{ 377 "data":JSON.stringify(data) 378 }, 379 success:function(msg){ 380 if(msg.code==1){ 381 layer.msg("å¯ç ä¿®æ¹æå"); 382 $(".forgetWrap").hide(); 383 $(".loginWrap").show(); 384 }else{ 385 layer.msg(msg.message); 386 } 387 } 388 }) 389})
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.