PageSourceSearch

https://pic.iyingdi.com/yingdi_pc_old/prod/js/user/web.user.login.js

js iyingdi.com collected 2026-09-24 17:43:08 UTC 83,282 bytes, 2,009 lines download raw bytes

1/*用户登陆模块*/
2/*web.user.login.js*/
3
4	web.user.login = (function(){
5		'use strict';
6
7		var configMap,stateMap,initModule,loginView,loginCallback,toLogin,toLogout,GetQueryString,util,checkUtil,
8			// sdk = new WSDK(),
9			changeNav,findPwdModal,thirdConfigPwd,setTimeoutItem,getMsgObj,qrCodeLogin;
10
11		configMap={
12			ajax_handler: '/',
13			image_url:'https://wspic.iyingdi.com/',
14			cookie_expire_month:24*30*60*60*1000,
15			login_logo:'https://wspic.iyingdi.com/static/images/user/logo.png',
16			email_logo:'https://wspic.iyingdi.com/static%2Fimages%2Fwebimg%2Femail_logo.png',
17			error_logo:'',
18			cancel_img:'https://wspic.iyingdi.com/static%2Fimages%2Fwebimg%2Fcancel.png',
19			head_img_default:'https://wspic.iyingdi.com/static%2Fimages%2Fwebimg%2Fhead_img.jpg',
20			current_user:null,
21			setRetrySendUserName:null,
22			system_msg:0,
23			forum_reply_msg:0,
24			article_reply_msg:0,
25			secret_chat_msg:0,
26			public_msg:0,
27			secretChat_unreadList:{},
28            destroyBubble:function (event) {
29                event.preventDefault();
30                if (event && event.stopPropagation) {
31                    event.stopPropagation();
32                }
33                else {
34                    event.cancelBubble = true;
35                }
36            },
37		};
38
39		stateMap={
40			user_valid:1,
41			password_valid:1,
42			confirmPassword_valid:1,
43			email_valid:1,
44			code_valid:1,
45			user_name:null,
46			user_id:null,
47			login_time:null,
48			comment_info:null,//评论
49			shop_info:null//商城
50		};
51
52		getMsgObj = function(){
53			return {
54				article_reply_msg:configMap.article_reply_msg,
55				forum_reply_msg:configMap.forum_reply_msg,
56				secret_chat_msg:configMap.secret_chat_msg,
57				system_msg:configMap.system_msg,
58				total_msg:Number(configMap.article_reply_msg)+Number(configMap.forum_reply_msg)+Number(configMap.system_msg)+Number(configMap.sysMsg),
59				public_msg:configMap.public_msg
60			};
61		};
62
63		GetQueryString = function (name){
64	     	var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
65	     	var r = window.location.search.substr(1).match(reg);
66	     	if(r!=null)return  decodeURI(r[2]); return null;
67		};
68
69		util={
70			weixinLogin:function(){
71				var code = GetQueryString('code');
72				$.post(web.hostMap.host_pre+"user/signin/weixin",{code:code},function(data){
73					if(data.success){
74						console.log('微信登录user/signin/weixin返回值',data);
75						if(data.token){//登录成功(已注册)
76							if(data.user.bind&&data.user.bind>0){//第三方登陆用户已设置营地密码
77								loginCallback({
78									name:data.user.username,
79									token:data.token,
80									impassword:data.impassword,
81									last:data.user.last,
82									head:data.user.head,
83									status:data.user.status,
84									badge:data.user.badge,
85									refresh_token:data.refresh_token,
86									userid:data.user.id,
87									userGroup:data.user.userGroup,
88									userKey:data.user.userKey,
89									phone:data.user.phone,
90									fire:data.user.fire,
91									credits:data.user.credits,
92									is_vip: (data.user.vipId ? true : false)
93								});
94							}
95							else{//第三方用户未设置密码
96								$('.overlay').remove();//去除登录框遮罩层
97								$('.login_frame').remove();//去除登录框
98								thirdConfigPwd(data,data.user.phone);
99							}
100						}
101						else{//未注册
102							if(web.user.register){
103								web.user.register.weixinRegister(data);
104							}
105							else{
106								$.getScript(web.hostMap.file_pre+"js/user/web.user.register.js?v="+new Date().getTime())
107								.done(function(){
108									web.user.register.weixinRegister(data);
109								});
110							}
111						}
112					}
113					else{
114						web.utility.showBasicPrompt({
115							content:'微信登录失败!',
116							style:'alert-error'
117						});
118					}
119				},'json');
120			},
121			sdkLogin:function(user_name,impassword,redirect_uri){
122				// console.log('密码',impassword);
123				if(web.chitchat){
124					web.chitchat.startListening();
125				}
126				else{
127					web.utility.addCSS(web.hostMap.file_pre+"css/chitchat/web.chitchat.css?timestamp="+new Date().getTime());
128					$.getScript(web.hostMap.file_pre+'js/chitchat/web.chitchat.js?timestamp='+new Date().getTime())
129					.done(function(){
130						web.chitchat.startListening();
131					});
132				}
133				$.get(web.hostMap.host_pre+'user/personal',{token:web.user.getUser('token'),version:600},function(data){
134					if(data.success){
135						configMap.article_reply_msg = data.newImMsg.comment;
136						configMap.forum_reply_msg = data.newImMsg.postV2;
137						configMap.secret_chat_msg = data.newImMsg.msg;
138						configMap.system_msg = data.newImMsg.achievement+data.newImMsg.article+data.newImMsg.badge+data.newImMsg.contribute+data.newImMsg.deliver+data.newImMsg.feedback+data.newImMsg.gameEvaluate+data.newImMsg.matchs;
139						configMap.total_msg = configMap.system_msg+configMap.article_reply_msg+configMap.forum_reply_msg+configMap.secret_chat_msg;
140		    			configMap.public_msg = 0;
141		    			if(!localStorage.getItem('public_msg_count')){
142							localStorage.setItem('public_msg_count',data.newSysNotify);
143		    				configMap.public_msg = data.newSysNotify;
144		    			}
145		    			else{
146		    				var old_public_count = localStorage.getItem('public_msg_count');
147		    				if(data.newSysNotify>old_public_count){
148		    					configMap.public_msg = data.newSysNotify-Number(old_public_count);
149								localStorage.setItem('public_msg_count',data.newSysNotify);
150		    				}
151		    				else{
152		    					configMap.public_msg = 0;
153		    				}
154		    			}
155		    			web.navigationBar.updateMsg(getMsgObj());
156					}
157		    		util.sdkLoginCallBack(redirect_uri);
158
159		    		//针对未绑定手机号的已登录用户
160		    // 		if(data.success&&data.user.phone==''){
161		    // 			if(!(localStorage.getItem('authentication_status')&&localStorage.getItem('authentication_status')=='1')){
162						// 	web.modalFrame.showModal({
163						// 		content:String()+
164						// 			'<div class="real-name-authentication-modal">'+
165						// 				'<div class="authentication-title">实名认证提醒</div>'+
166						// 				'<div class="authentication-content">'+
167						// 					'<p>根据《互联网论坛社区服务管理规定》,自2017年10月1日起,互联网论坛社区需按照“后台实名、前台自愿”的原则,对所有用户进行实名认证。平台不能向未提供真实身份信息的用户提供信息发布服务。</p>'+
168						// 					'<p> 因此自2017年10月1日起,营地将对普通用户强制实行基于移动电话的电信实名认证。<span style="color:#e5746b">未绑定手机号的用户将无法正常使用文章评论和论坛功能。</span></p>'+
169						// 					'<div>为了您的正常使用,请尽快绑定手机号。</div>'+
170						// 				'</div>'+
171						// 				'<div class="authentication-footer">'+
172						// 					'<div id="no_prompt">'+
173						// 						'<i></i>'+
174						// 						'<span>不再显示此消息</span>'+
175						// 					'</div>'+
176						// 					'<div class="pull-right">'+
177						// 						'<span>(资料设置-绑定手机号)</span>'+
178						// 						'<span id="later_on_authentication" class="later-on">稍后绑定</span>'+
179						// 						'<a data-ajax href="/web/personal/own/infoConfig">马上绑定</a>'+
180						// 					'</div>'+
181						// 				'</div>'+
182						// 			'</div>',
183						// 		content_width:'700px',
184						// 		click_modal_background_to_cancel:true,
185						// 		initialize_function:function(){
186						// 			$('#later_on_authentication').off().on('click',function(){
187						// 				web.modalFrame.closeModal();
188						// 			});
189						// 			$('#no_prompt').off().on('click',function(){
190						// 				if($(this).hasClass('checked')){
191						// 					$(this).removeClass('checked');
192						// 					localStorage.setItem('authentication_status','0');
193						// 				}
194						// 				else{
195						// 					$(this).addClass('checked');
196						// 					localStorage.setItem('authentication_status','1');
197						// 				}
198						// 			});
199						// 		},
200						// 	}
200,'no-style');
201						// }
202		    // 		}
203				});
204			},
205
206			sdkLoginCallBack:function(redirect_uri){
207				var pathname =  window.location.pathname;
208				if(redirect_uri&&redirect_uri.length>0){
209					if(redirect_uri!='init'){
210						window.location.href = redirect_uri
211					}
212				}
213				else{
214					if(pathname=="/web/user/login/weixin"||pathname=="/web/user/login/findPwd"){
215						if(GetQueryString('loginCallback')){
216							if(decodeURIComponent(GetQueryString('loginCallback')=='https://'+window.location.host+'/web/user/register')){
217								window.location.href = 'https://'+window.location.host;
218							}
219							else{
220								window.location.href = decodeURIComponent(GetQueryString('loginCallback'));
221							}
222						}
223						else{
224							window.location.href = 'https://'+window.location.host;
225						}
226					}
227					else if(pathname=="/web/user/register"){
228						window.location.href = 'https://'+window.location.host;
229					}
230					else if(pathname.indexOf('/web/admin')>=0){
231						window.location.href = window.location.href;
232					}
233					else{
234						window.location.href = window.location.href;
235					}
236				}
237			},
238
239			setCookie:function(arg_map){
240				var cookie_name=(arg_map.name) ? encodeURIComponent(arg_map.name) : null,
241					cookie_value=encodeURIComponent(arg_map.value)||'',
242					cookie_path=arg_map.path||'/',
243					cookie_expires=arg_map.expires,
244					cookie_text=null;
245
246				if(cookie_name){
247					cookie_text=cookie_name+'='+cookie_value;
248				}
249				else{
250					return false;
251				}
252				if(cookie_expires instanceof Date){
253					cookie_text+=';expires='+cookie_expires.toUTCString();
254				}
255				if(cookie_path){
256					cookie_text+=';path='+cookie_path;
257				}
258				document.cookie=cookie_text;
259			},
260
261			getCookie:function(name){
262				var cookie_name=encodeURIComponent(name)+'=',
263					cookie_start=document.cookie.indexOf(cookie_name),
264					cookie_end=null,
265					cookie_value=null;
266				if(cookie_start>-1){
267					cookie_end=document.cookie.indexOf(';',cookie_start);
268					if(cookie_end==-1){
269						cookie_end=document.cookie.length;
270					}
271					cookie_value=decodeURIComponent(document.cookie.substring(cookie_start+cookie_name.length,cookie_end));
272				}
273				return cookie_value;
274			},
275
276			unsetCookie:function(arg_map){
277				arg_map.value='';
278				arg_map.expires=new Date(0);
279				util.setCookie(arg_map);
280			},
281
282			getSecretChatMsg:function(){
283				return configMap.secret_chat_msg;
284			},
285
286			getSecretChatUnRead:function(){
287				return configMap.secretChat_unreadList;
288			},
289
290			getSystemMsg:function(){
291				return configMap.system_msg;
292			},
293
294			getReplyMsg:function(){
295				return configMap.article_reply_msg+configMap.forum_reply_msg;
296			},
297
298			getArticleReplyMsg:function(){
299				return configMap.article_reply_msg;
300			},
301
302			getForumReplyMsg:function(){
303				return configMap.forum_reply_msg;
304			},
305
306			setSecretChatMsg:function(num){
307				configMap.secret_chat_msg = num;
308			},
309
310			setArticleReplyMsg:function(num){
311				configMap.article_reply_msg = num;
312			},
313
314			setForumReplyMsg:function(num){
315				configMap.forum_reply_msg = num;
316			},
317			setSystemMsg:function(num){
318				configMap.system_msg = num;
319			},
320
321			// loadPage:function(arg_map){
322			// 	var page_html=arg_map.page_html||'无法加载页面',
323			// 		callback=arg_map.callback||function(){},
324			// 		page_id=arg_map.page_id||('page'+Math.round(Math.random()*10000)),
325			// 		page_frame=String()
326			// 				+page_html;
327			// 	$('.wrap-content,.overlay').remove();
328			// 	jqueryMap.$body.append(page_frame);
329			// 	$('#close-page').remove();
330			// 	callback();
331			// 	JPlaceHolder.init();
332			// },
333
334			appendPage:function(arg_map){
335				var page_html=arg_map.page_html||'无法加载页面',
336					callback=arg_map.callback||function(){},
337					page_id=arg_map.page_id||('page'+Math.round(Math.random()*10000)),
338					page_frame=String()
339							+'<div class="overlay"></div>'
340							+page_html;
341				$('.web-frame').append(page_frame);
342
343				callback();
344				$('.overlay').click(function(){
345					var $this = $(this);
346					$this.siblings('.login_frame').remove();
347					$this.remove();
348					qrCodeLogin.endPolling();
349				});
350				// JPlaceHolder.init();
351			},
352
353			closePage:function(){
354				var $this = $(this).closest('.login_frame');
355				qrCodeLogin.endPolling();
356				$this.siblings('.overlay').remove();
357				$this.remove();
358			},
359		};
360
361		changeNav = function(user,action,ifinit){//改变导航栏的用户登陆样式
362			if(action=='login'){
363				if(ifinit&&ifinit=='init'){
364					web.navigationBar.userLogin({'user_id':user.userid,'user_name':user.name,'user_avatar':user.head},'init');
365				}
366				else{
367					web.navigationBar.userLogin({'user_id':user.userid,'user_name':user.name,'user_avatar':user.head});
368				}
369			}
370			else if(action=='logout'){
371				web.navigationBar.userLogout();
372			}
373		};
374
375		loginCallback=function(arg_map,redirect_uri){//写入cookie
376			var expire_date_time = new Date().getTime();
377			var expire_date = new Date(expire_date_time+29*24*60*60*1000);
378			util.setCookie({
379				name:'user',
380				value:arg_map.name,
381				expires:expire_date
382			});
383			util.setCookie({
384				name:'userid',
385				value:arg_map.userid,
386				expires:expire_date
387			});
388			util.setCookie({
389				name:'userGroup',
390				value:arg_map.userGroup,
391				expires:expire_date
392			});
393			util.setCookie({
394				name:'userKey',
395				value:arg_map.userKey,
396				expires:expire_date
397			});
398			util.setCookie({
399				name:'credits',
400				value:arg_map.credits,
401				expires:expire_date
402			});
403			util.setCookie({
404				name:'fire',
405				value:arg_map.fire,
406				expires:expire_date
407			});
408			util.setCookie({
409				name:'is_vip',
410				value:arg_map.is_vip,
411				expires:expire_date
412			});
413			var token_date = new Date(expire_date_time+23*60*60*1000);
414			util.setCookie({//实际有效期24小时
415				name:'token',
416				value:arg_map.token,
417				expires:token_date
418			});
419			util.setCookie({
420				name:'badge',
421				value:arg_map.badge,
422				expires:expire_date
423			});
424			util.setCookie({//实际有效期30天
425				name:'refreshToken',
426				value:arg_map.refresh_token,
427				expires:expire_date
428			});
429			util.setCookie({
430				name:'last',
431				value:arg_map.last,
432				expires:expire_date
433			});
434			util.setCookie({
435				name:'headimage',
436				value:arg_map.head,
437				expires:expire_date
438			});
439			util.setCookie({
440				name:'phone',
441				value:arg_map.phone,
442				expires:expire_date
443			});
444			util.setCookie({
445				name:'impassword',
446				value:arg_map.impassword,
447				expires:expire_date
448			});
449			util.setCookie({
450				name:'status',
451				value:arg_map.status,
452				expires:expire_date
453			});
454			// changeNav(arg_map,'login','init');
455			util.sdkLogin(arg_map.name,arg_map.impassword,redirect_uri);
456			$('.login_frame,.overlay').remove();
457		};
458
459		checkUtil={
460			error_time:0,
461            add_warning:function(warning_text,$input){
462               /* var warning_html=String()
463                    +'<small class="user_inputWarning">'+warning_text+'</small>';
464                $input.closest('.form-group').addClass('user-inputError').after(warning_html);*/
465               $('.login_frame .user_inputWarning').text(warning_text);
466            },
467            remove_warning:function($input){
468                /*$input.closest('.form-group').removeClass('user-inputError').next('.user_inputWarning').remove();*/
469                $('.login_frame .user_inputWarning').text('');
470            },
471            username_password_code_check: function () { //用户名,密码,验证码校验
472				checkUtil.remove_warning();
473                if (!$('#user-inputUsername').val()) {
474                    checkUtil.add_warning('请输入用户名');
475                    stateMap.user_valid = 0;
476                    return false;
477                }
478                if (!$('#user-inputPassword').val()) {
479                    checkUtil.add_warning('请输入密码');
480                    stateMap.password_valid = 0;
481                    return false;
482                }
483                if ($('#user-inputCode').length>0 && !$('#user-inputCode').val()) {
484                    checkUtil.add_warning('请输入验证码');
485                    stateMap.code_valid = 0;
486                    return false;
487                }
488            },
489			username_check:function(){
490				var $username_input=$('#user-inputUsername'),
491					text_value=$username_input.val(),
492					text_length=text_value.length;
493				checkUtil.remove_warning($username_input);
494				if(text_length<1){
495					checkUtil.add_warning('请输入用户名',$username_input);
496					stateMap.user_valid=0;
497				}else{
498					stateMap.user_valid=1;
499				}
500			},
501			password_check:function(){
502				var $password_input=$('#user-inputPassword'),
503					text_value=$password_input.val(),
504					text_length=text_value.length;
505				checkUtil.remove_warning($password_input);
506				if(text_length<1){
507					checkUtil.add_warning('请输入密码',$password_input);
508					stateMap.password_valid=0;
509				}
510				else{
511					stateMap.password_valid=1;
512				}
513			},
514			code_user_check:function(){
515				var $code_input=$('#user-inputCode'),
516					code_value=$code_input.val();
517				checkUtil.remove_warning($code_input);
518				//邮箱格式验证
519				if(code_value){
520					stateMap.code_valid=1;
521				}else{
522					checkUtil.add_warning('请输入验证码',$code_input);
523					stateMap.code_valid=0;
524				}
525			},
526			login_check:function(){
527				//密码正确性验证
528				var name=$('#user-inputUsername').val(),
529					$username_password=$('#user-inputPassword'),
530					password=$username_password.val(),
531					code_html=String()+
532						'<div class="form-checkCode">'+
533						'	<input type="text" id="user-inputCode" placeholder="验证码">'+
534						'	<div class="code_img">
534<img src="'+web.hostMap.host_pre+'code?v='+new Date().getTime()+'"></div>'+
535						'	<a id="login_replace_codeimg" class="small">换一张</a>'+
536						'</div>';
537				/*$('#user-inputUsername,#user-inputPassword').trigger('change');*/
538				checkUtil.username_password_code_check();
539				if(stateMap.user_valid==1&&stateMap.password_valid==1){
540					// $.post(web.hostMap.host_pre+"user/signin/web",{username:name,password:password},function(data){
541					// 	if(data.success){
542					// 		loginCallback({
543					// 			name:data.user.username,
544					// 			token:data.token,
545					// 			impassword:data.impassword,
546					// 			last:data.user.last,
547					// 			head:data.user.head,
548					// 			status:data.user.status,
549					// 			badge:data.user.badge,
550					// 			refresh_token:data.refresh_token,
551					// 			userid:data.user.id,
552					// 			userGroup:data.user.userGroup,
553					// 			userKey:data.user.userKey,
554					// 		});
555					// 	}
556					// 	else{
557					// 		checkUtil.remove_warning($username_password);
558					// 		checkUtil.add_warning(data.msg,$username_password);
559					// 		//当用户名和密码输错三次就出现验证码
560					// 		if(data.inputCount>=3){
561					// 			$username_password.parent().after(code_html);
562					// 			$('#login_replace_codeimg').click(function(){
563					// 				$(this).prev().children('img').attr('src', web.hostMap.host_pre+'code?v='+new Date().getTime());
564					// 			});
565					// 			$('#user-inputCode').change(checkUtil.code_user_check);
566					// 			$('#user-userSubmit').off().on("click",checkUtil.login_code_check);
567					// 		}
568					// 	}
569					// },'json');
570					var timestamp = parseInt(new Date().getTime()/1000),
571						appKey = 'e5Q5dMa32s1kyi87o5g1D3Fg1ku5O4RT',
572						appSecret = 'W15Jyt87GH1m12rYUki4Fip87s5z142g1Ad4Ut64sR8t4JS54iYu87O7ps5RQ12g',
573						md5_passwd = $.md5('sutUsdflweD'+$.md5(password).toUpperCase()+'Djklet5').toUpperCase(),
574						signature = $.md5(appKey + appSecret + (timestamp%111111 + timestamp%654321) + name).toUpperCase();
575					$.post(web.hostMap.host_pre+"user/login/v2",{username:name,password:md5_passwd,system:'web',appKey:appKey,timestamp:timestamp,signature:signature},function(data){
576						if(data.success){
577							loginCallback({
578								name:data.user.username,
579								token:data.token,
580								impassword:data.impassword,
581								last:data.user.last,
582								head:data.user.head,
583								status:data.user.status,
584								badge:data.user.badge,
585								refresh_token:data.refresh_token,
586								userid:data.user.id,
587								userGroup:data.user.userGroup,
588								userKey:data.user.userKey,
589								phone:data.user.phone,
590								fire:data.user.fire,
591								credits:data.user.credits,
592								is_vip: (data.user.vipId ? true : false)
593							});
594						}
595						else{
596							checkUtil.remove_warning($username_password);
597							checkUtil.add_warning(data.msg,$username_password);
598							//当用户名和密码输错三次就出现验证码
599							if(data.inputCount>=3){
600								$username_password.parent().after(code_html);
601								$('#login_replace_codeimg').click(function(){
602									$(this).prev().children('img').attr('src', web.hostMap.host_pre+'code?v='+new Date().getTime());
603								});
604								$('#user-inputCode').change(checkUtil.code_user_check);
605								$('#user-userSubmit').off().on("click",checkUtil.login_code_check);
606							}
607						}
608					},'json');
609				}else{
610				}
611			},
612			login_code_check:function(){
613				//密码正确性验证
614				var name=$('#user-inputUsername').val(),
615					$username_password=$('#user-inputPassword'),
616					password=$username_password.val(),
617					$code=$('#user-inputCode'),
618					code=$code.val();
619                /*$('#user-inputUsername,#user-inputPassword,#user-inputCode').trigger('change');*/
620                checkUtil.username_password_code_check();
621				if(stateMap.user_valid==1&&stateMap.password_valid==1&&stateMap.code_valid==1){
622					// $.post(web.hostMap.host_pre+"user/signin/web",{username:name,password:password,code:code},function(data){
623					// 	if(data.success){
624					// 		loginCallback({
625					// 			name:data.user.username,
626					// 			token:data.token,
627					// 			impassword:data.impassword,
628					// 			last:data.user.last,
629					// 			head:data.user.head,
630					// 			status:data.user.status,
631					// 			badge:data.user.badge,
632					// 			refresh_token:data.refresh_token,
633					// 			userid:data.user.id,
634					// 			userGroup:data.user.userGroup,
635					// 			userKey:data.user.userKey,
636					// 		});
637					// 	}
638					// 	else{
639					// 		checkUtil.remove_warning($code);
640					// 		checkUtil.add_warning(data.msg,$code);
641					// 		$('#login_replace_codeimg').trigger('click');
642					// 	}
643					// },'json');
644					var timestamp = parseInt(new Date().getTime()/1000),
645						appKey = 'e5Q5dMa32s1kyi87o5g1D3Fg1ku5O4RT',
646						appSecret = 'W15Jyt87GH1m12rYUki4Fip87s5z142g1Ad4Ut64sR8t4JS54iYu87O7ps5RQ12g',
647						md5_passwd = $.md5('sutUsdflweD'+$.md5(password).toUpperCase()+'Djklet5').toUpperCase(),
648						signature = $.md5(appKey + appSecret + (timestamp%111111 + timestamp%654321) + name).toUpperCase();
649					$.post(web.hostMap.host_pre+"user/login/v2",{username:name,password:md5_passwd,code:code,system:'web',appKey:appKey,timestamp:timestamp,signature:signature},function(data){
650						if(data.success){
651							loginCallback({
652								name:data.user.username,
653								token:data.token,
654								impassword:data.impassword,
655								last:data.user.last,
656								head:data.user.head,
657								status:data.user.status,
658								badge:data.user.badge,
659								refresh_token:data.refresh_token,
660								userid:data.user.id,
661								userGroup:data.user.userGroup,
662								userKey:data.user.userKey,
663								phone:data.user.phone,
664								fire:data.user.fire,
665								credits:data.user.credits,
666								is_vip: (data.user.vipId ? true : false)
667							});
668						}
669						else{
670							checkUtil.remove_warning($code);
671							checkUtil.add_warning(data.msg,$code);
672							$('#login_replace_codeimg').trigger('click');
673						}
674					},'json');
675				}else{
676				}
677			},
678		}
679
680		loginView = {//登录相关的各个页面
681
682			//普通浏览器登陆界面
683			normal_html:new String()
684				+'<div class="login_frame">'
685					+'<div class="login_frame_top">'
686						+'<a id="close-page" class="close">'
687							+'<img src="'+configMap.image_url+'yingdiWeb/images/user/login/close.png">'
688						+'</a>'
689						+'<div class="login_logoImg"><img src="'+configMap.image_url+'yingdiWeb/images/user/login/logo.png"></div>'
690						+'<div id="login-switch" class="switchLogin" data-type="qrCode">'
691            				+'<img src="'+configMap.image_url+'yingdiWeb/images/user/login/qr.png">'
692						+'</div>'
693					+'</div>'
694					+'<div class="login_frame_content">'
695						+'<div class="form-group">'
696							+'<input type="text" id="user-inputUsername" value="" placeholder="用户名 / 手机号">'
697						+'</div>'
698            			+'<div class="form-group">'
699            				+'<input type="password" id="user-inputPassword" value="" placeholder="密码">'
700            			+'</div>'
701						+'<div class="form_other">'
702							+'<div class="user_inputWarning"></div>'
703							+'<div class="checkbox">'
704								+'<label class="small"><input id="login_state" type="checkbox" checked="checked">记住登录状态</label>'
705							+'</div>'
706							+'<div class="register">'
707								+'<span>没有账号?</span>'
708								+'<a data-ajax href="/web/user/register" id="toRegister" style="margin-right: 20px">立即注册</a>'
709            					+'<a data-ajax href="/web/user/login/findPwd?loginCallback='+encodeURIComponent(window.location.href)+'">忘记密码?</a>'
710							+'</div>'
711						+'</div>'
712						+'<div style="margin-bottom: 4px;">'
713							+'<button id="user-userSubmit" type="button" class="loginBtn">登录</button>'
714							+'<div class="thirdPart">'
715								+'<span>第三方账号登录</span>'
716								+'<div id="login_weixin" class="icon"></div>'
717            					+'<div id="qq_connect_btn" class="icon" onclick="return window.open(\'https://graph.qq.com/oauth2.0/authorize?client_id=101267105&amp;response_type=token&amp;scope=all&amp;redirect_uri=http%3A%2F%2Fqzonestyle.gtimg.cn%2Fqzone%2Fopenapi%2Fredirect-1.0.1.html\', \'oauth2Login_10537\' ,\'height=525,width=585, toolbar=no, menubar=no, scrollbars=no, status=no, location=yes, resizable=yes\');"></div>'
718								// +'<div id="wb_connect_btn" class="icon"></div>'
719							+'</div>'
720						+'</div>'
721					+'</div>'
722					+'<div class="login_frame_qrcode hidden">'
723						+'<div class="passMsg">使用密码登录</div>'
724						+'<div class="photo">'
725							+ '<div class="image">'
726								+'<img class="qr" src="'+configMap.image_url+'yingdiWeb/images/user/login/qr-loading.png">'
727								+'<div class="tutorial">'
728									+'<img class="qr" src="'+configMap.image_url+'yingdiWeb/images/user/login/tutorial.png">'
729								+'</div>'
730							+'</div>'
731							+ '<p>打开最新旅法师营地App</p>'
732							+ '<p>在个人中心页面右上角打开扫一扫</p>'
733						+'</div>'
734						+'<div class="result hidden">'
735							+'<div class="image">'
736								 +'<img src="'+configMap.image_url+'yingdiWeb/images/user/login/scansuccess.png" alt="">'
737							+'</div>'
738							+'<p>扫描成功,请在手机上确认登录</p>'
739							+'<a id="gobackQrCode">返回二维码</a>'
740						+'</div>'
741					+'</div>'
742				+'</div>',
743
744			//IE浏览器登陆界面
745			ie_html:new String()
746            +'<div class="login_frame">'
747            +'<div class="login_frame_top">'
748            +'<a id="close-page" class="close">'
749            +'<img src="'+configMap.image_url+'yingdiWeb/images/user/login/close.png">'
750            +'</a>'
751            +'<div class="login_logoImg"><img src="'+configMap.image_url+'yingdiWeb/images/user/login/logo.png"></div>'
752            +'<div id="login-switch" class="switchLogin" data-type="qrCode">'
753            +'<img src="'+configMap.image_url+'yingdiWeb/images/user/login/qr.png">'
754            +'</div>'
755            +'</div>'
756            +'<div class="login_frame_content">'
757            +'<div class="form-group">'
758            +'<input type="text" id="user-inputUsername" value="" placeholder="用户名">'
759            +'</div>'
760            +'<div class="form-group">'
761            +'<input type="password" id="user-inputPassword" value="" placeholder="密码">'
762            +'</div>'
763            +'<div class="form_other">'
764            +'<div class="user_inputWarning"></div>'
765            +'<div class="checkbox">'
766            +'<label class="small"><input id="login_state" type="checkbox" checked="checked">记住登录状态</label>'
767            +'</div>'
768            +'<div class="register">'
769            +'<span>没有账号?</span>'
770            +'<a id="toRegister" style="margin-right: 20px">立即注册</a>'
771            +'<a data-ajax href="/web/user/login/findPwd?loginCallback='+encodeURIComponent(window.location.href)+'">忘记密码?</a>'
772            +'</div>'
773            +'</div>'
774            +'<div style="margin-bottom: 4px;">'
775            +'<button id="user-userSubmit" type="button" class="loginBtn">登录</button>'
776            +'<div class="thirdPart">'
777            +'<span>第三方账号登录</span>'
778            	+'<div id="login_weixin" class="icon"></div>'
779           		+'<div id="qq_connect_btn" class="icon" onclick="return window.open(\'https://graph.qq.com/oauth2.0/authorize?client_id=101267105&amp;response_type=token&amp;scope=all&amp;redirect_uri=http%3A%2F%2Fqzonestyle.gtimg.cn%2Fqzone%2Fopenapi%2Fredirect-1.0.1.html\', \'oauth2Login_10537\' ,\'height=525,width=585, toolbar=no, menubar=no, scrollbars=no, status=no, location=yes, resizable=yes\');"></div>'
780				// +'<div id="wb_connect_btn" class="icon"></div>'
781            +'</div>'
782            +'</div>'
783            +'</div>'
784            +'<div class="login_frame_qrcode hidden">'
785            +'<div class="passMsg">使用密码登录</div>'
786            +'<div class="photo">'
787            + '<div class="image">'
788            +'<img class="qr" src="'+configMap.image_url+'yingdiWeb/images/user/login/qr-loading.png">'
789            +'<div class="tutorial">'
790            +'<img class="qr" src="'+configMap.image_url+'yingdiWeb/images/user/login/tutorial.png">'
791            +'</div>'
792            +'</div>'
793            + '<p>打开最新旅法师营地App</p>'
794            + '<p>在个人中心页面右上角打开扫一扫</p>'
795            +'</div>'
796            +'<div class="result hidden">'
797            +'<div class="image">'
798            +'<img src="'+configMap.image_url+'yingdiWeb/images/user/login/scansuccess.png" alt="">'
799            +'</div>'
800            +'<p>扫描成功,请在手机上确认登录</p>'
801            +'<a id="gobackQrCode">返回二维码</a>'
802            +'</div>'
803            +'</div>'
804            +'</div>',
805
806			//通过手机号找回密码  填写手机号及验证码页面
807			findPwd_html:String()+
808				'<div class="login-findPwd-frame login-relatePwd-frame">'+
809					'<div class="findPwd-frame-content">'+
810						'<div class="yingdi-logo"><img src="'+configMap.login_logo+'"></div>'+
811						'<div class="login-relatePwd-frame-textTip">找回密码</div>'+
812						'<div class="login-relatePwd-frame-textTip-small">目前此功能只支持绑定过手机号的用户</div>'+
813						'<div class="login-relatePwd-frame-infoInputArea">'+
814							'<div class="login-relatePwd-frame-infoInputItem">'+
815								'<input id="user_phoneNum" class="user_phoneNum" type="text" placeholder="输入绑定的手机号">'+
816								'<span class="required"></span>'+
817							'</div>'+
818							'<div class="login-relatePwd-frame-infoInputItem">'+
819								'<input id="check_code" class="check_code" type="text" placeholder="验证码">'+
820								'<button id="findPwd_send_check_code" class="send_check_code">发送验证码</button>'+
821								'<span class="required"></span>'+
822							'</div>'+
823						'</div>'+
824						'<div class="finishCommit"><button id="findPwdBtn">找回密码</button></div>'+
825					'</div>'+
826				'</div>',
827			//通过手机号找回密码  手机验证码验证成功后 填写新密码页面
828			modifyPwd_html:String()+
829				'<div class="login-findPwd-frame login-relatePwd-frame">'+
830					'<div class="findPwd-frame-content">'+
831						'<div class="yingdi-logo"><img src="'+configMap.login_logo+'"></div>'+
832						'<div class="login-relatePwd-frame-textTip">修改密码</div>'+
833						'<div class="login-relatePwd-frame-infoInputArea">'+
834							'<div class="login-relatePwd-frame-infoInputItem">'+
835								'<input id="user_password" class="user_password" type="password" placeholder="新密码 长度不小于8位">'+
836								'<span class="required"></span>'+
837							'</div>'+
838							'<div class="login-relatePwd-frame-infoInputItem">'+
839								'<input id="confirm_password" class="confirm_password" type="password" placeholder="再输入一次密码">'+
840								'<span class="required"></span>'+
841							'</div>'+
842						'</div>'+
843						'<div class="finishCommit"><button id="modifyPwdBtn">确认修改</button></div>'+
844					'</div>'+
845				'</div>',
846			//通过手机号找回密码 密码成功修改页面
847			modifyPwd_success_html:String()+
848				'<div class="login-findPwd-frame login-relatePwd-frame">'+
849					'<div class="findPwd-frame-content">'+
850						'<div class="yingdi-logo"><img src="'+configMap.login_logo+'"></div>'+
851						'<div class="login-relatePwd-frame-textTip">密码修改成功<br/>请牢记您的密码</div>'+
852					'</div>'+
853				'</div>',
854
855			//第三方已注册用户补充密码
856			thirdPwd_config_html:String()+
857				'<div class="login-thirdPwdConfig-frame login-relatePwd-frame">'+
858					'<div class="thirdPwdConfig-frame-content">'+
859						'<div class="yingdi-logo"><img src="'+configMap.login_logo+'"></div>'+
860						'<div class="login-relatePwd-frame-textTip-small">由于用户系统升级,请玩家为自己的账号设置登录密码<br/>今后除了使用第三方登录,你也可以使用营地账号登录</div>'+
861						'<div class="login-relatePwd-frame-infoInputArea">'+
862							'<div class="login-relatePwd-frame-infoInputItem">'+
863								'<input id="user_password" class="user_password" type="password" placeholder="密码 长度不小于8位">'+
864								'<span class="required"></span>'+
865							'</div>'+
866							'<div class="login-relatePwd-frame-infoInputItem">'+
867								'<input id="confirm_password" class="confirm_password" type="password" placeholder="再输入一次密码">'+
868								'<span class="required"></span>'+
869							'</div>'+
870							'<div class="login-relatePwd-frame-infoInputItem phoneNumArea hidden">'+
871								'<input id="user_phoneNum" class="user_phoneNum" type="text" placeholder="输入绑定的手机号">'+
872								// '<span class="required">★</span>'+
873							'</div>'+
874							'<div class="login-relatePwd-frame-infoInputItem phoneNumArea hidden">'+
875								'<input id="check_code" class="check_code" type="text" placeholder="验证码">'+
876								'<button id="thirdPwdConfig_send_check_code" class="send_check_code">发送验证码</button>'+
877								// '<span class="required">★</span>'+
878							'</div>'+
879						'</div>'+
880						'<div class="finishCommit"><button id="configThirdPwd">完成升级</button></div>'+
881					'</div>'+
882				'</div>',
883			thirdPwd_config_success_html:String()+
884				'<div class="login-thirdPwdConfig-frame login-relatePwd-frame">'+
885					'<div class="findPwd-frame-content">'+
886						'<div class="yingdi-logo"><img src="'+configMap.login_logo+'"></div>'+
887						'<div class="login-relatePwd-frame-textTip">账号升级成功<br/>请牢记您的密码</div>'+
888					'</div>'+
889				'</div>',
890
891			//登陆界面回调函数
892			callback:function(){
893				var $modal,
894					reset_username=String()+
895						'<div class="login_content_half pull-middle">'+
896						'	<h3 class="title_h3 text-middle">设置用户名</h3>'+
897						'	<form>'+
898						'		<div class="form-group">'+
899						'			<input type="text" class="form-control input-lg" id="user-inputUsername" placeholder="用户名:">'+
900						'		</div>'+
901						'		<button id="user-userSubmit" type="button" class="btn btn-primary btn-lg btn-block" >确定</button>'+
902						'		<div class="text-middle small text-footer"><p class="inline_block">请设置您的营地用户名!</div>'+
903						'	</form>'+
904						'</div>';
905				$('#user-inputUsername').change(checkUtil.username_check);//用户名验证
906				//密码验证
907				$('#user-inputPassword').change(checkUtil.password_check).on('keydown',function(evt){
908					if(evt.keyCode==13){
909						evt.preventDefault();
910						checkUtil.login_check();
911					}
912				});
913
914				$('#close-page').click(util.closePage);
915
916				// $('#toRegister').click(function(){
917				// 	$('.overlay').remove();
918				// 	$('.login_frame').remove();
919				// 	web.user.toRegister();
920				// });
921
922				$('#user-userSubmit').click(checkUtil.login_check);//账号密码登陆
923
924				$('#login_weixin').off().on('click',function(){//微信登录
925					var path = window.location.host+'/web/user/login/weixin?loginCallback='+(GetQueryString('loginCallback')&&GetQueryString('loginCallback').length>0?GetQueryString('loginCallback'):encodeURIComponent(window.location.href)),
926						appid = web.hostMap.weixin_appid;
927					window.open('https://open.weixin.qq.com/connect/qrconnect?appid='+appid+'&redirect_uri=https://'+path+'&response_type=code&scope=snsapi_login&state=STATE#wechat_redirect');
928				});
929
930				$('#qq_connect_btn').click(function(event) {//qq登录
931					if(navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.match(/8./i)=="8."){
932						alert('在此浏览器QQ账号无法登录,请尝试其他浏览器或营地账号登录!');
933					} else if(navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.match(/9./i)=="9."){
934						alert('在此浏览器QQ账号无法登录,请尝试其他浏览器或营地账号登录!');
935					} else{
936						/* Act on the event */
937						if(QC.Login.check()){
938							QC.Login.signOut();
939						}
940						QC.Login({
941						       //btnId:插入按钮的节点id,必选
942						       btnId:"",
943						       //用户需要确认的scope授权项,可选,默认all
944						       scope:"all",
945						       //按钮尺寸,可用值[A_XL| A_L| A_M| A_S|  B_M| B_S| C_S],可选,默认B_S
946						       size: "A_XL"
947						   }, function(reqData, opts){//登录成功
948						   		QC.Login.getMe(function(openId, accessToken){
949									$.post(web.hostMap.host_pre+"user/signin/social",{openid:openId,source:'qq',access_token:accessToken,system:'web'},function(data){
950										if(data.success){
951											if(data.user.bind&&data.user.bind>0){//第三方登陆用户已设置营地密码
952												loginCallback({
953													name:data.user.username,
954													token:data.token,
955													impassword:data.impassword,
956													last:data.user.last,
957													head:data.user.head,
958													status:data.user.status,
959													badge:data.user.badge,
960													refresh_token:data.refresh_token,
961													userid:data.user.id,
962													userGroup:data.user.userGroup,
963													userKey:data.user.userKey,
964													phone:data.user.phone,
965													fire:data.user.fire,
966													credits:data.user.credits,
967													is_vip: (data.user.vipId ? true : false)
968												});
969											}
970											else{//第三方用户未设置密码
971												$('.overlay').remove();//去除登录框遮罩层
972												$('.login_frame').remove();//去除登录框
973												thirdConfigPwd(data,data.user.phone);
974											}
975
976										}else{//第三方注册登陆
977											$('.overlay').remove();
978											$('.login_frame').remove();
979											if(web.user.register){
980												web.user.register.qqRegister(reqData,openId,accessToken);
981											}
982											else{
983												$.getScript(web.hostMap.file_pre+"js/user/web.user.register.js?v="+new Date().getTime())
984												.done(function(){
985													web.user.register.qqRegister(reqData,openId,accessToken);
986												});
987											}
988										}
989									},'json');
990								})
991						   }, function(opts){//注销成功
992
993						});
994					}
995				});
996
997				$('#wb_connect_btn').off().on('click',function(){//微博登录
998					var $this = $(this);
999				    if(WB2.checkLogin()){
1000						WB2.logout(function() {
1001							WB2.login(function() {
1002							   WB2.anyWhere(function(W){
1003								    //数据交互
1004								    W.parseCMD('/account/get_uid.json', function(oResult, bStatus) {
1005								        if(bStatus) {
1006								           W.parseCMD('/users/show.json', function(oResult1, bStatus) {
1007										        if(bStatus) {
1008										            $.post(web.hostMap.host_pre+"user/signin/social",{openid:oResult1.id,source:'weibo',access_token:WB2.oauthData.access_token,system:'web'},function(data){
1009														if(data.success){
1010															if(data.user.bind&&data.user.bind>0){//第三方登陆用户已设置营地密码
1011																loginCallback({
1012																	name:data.user.username,
1013																	token:data.token,
1014																	impassword:data.impassword,
1015																	last:data.user.last,
1016																	head:data.user.head,
1017																	status:data.user.status,
1018																	badge:data.user.badge,
1019																	refresh_token:data.refresh_token,
1020																	userid:data.user.id,
1021																	userGroup:data.user.userGroup,
1022																	userKey:data.user.userKey,
1023																	phone:data.user.phone,
1024																	fire:data.user.fire,
1025																	credits:data.user.credits,
1026																	is_vip: (data.user.vipId ? true : false)
1027																});
1028															}
1029															else{//第三方用户未设置密码
1030																$('.overlay').remove();//去除登录框遮罩层
1031																$('.login_frame').remove();//去除登录框
1032																thirdConfigPwd(data,data.user.phone);
1033															}
1034														}else{
1035															$('.overlay').remove();
1036															$('.login_frame').remove();
1037															if(web.user.register){
1038																web.user.register.weiboRegister(oResult1,WB2.oauthData.access_token);
1039															}
1040															else{
1041																$.getScript(web.hostMap.file_pre+"js/user/web.user.register.js?v="+new Date().getTime())
1042																.done(function(){
1043																	web.user.register.weiboRegister(oResult1,WB2.oauthData.access_token);
1044																});
1045															}
1046														}
1047													},'json');
1048										        }
1049										        else{
1050										        	console.log('未知错误',bStatus);
1051										        }
1052										    }, {
1053										        uid : oResult.uid
1054										    }, {
1055										        method : 'get',
1056										        cache_time : 30
1057										    });
1058								        }
1059								        else{
1060								        	console.log('未知错误',bStatus);
1061								        }
1062								    }, {
1063								        // screen_name : '姚晨'
1064								    }, {
1065								        method : 'get',
1066								        cache_time : 30
1067								    });
1068								});
1069							});
1070						});
1071					}
1072					else{
1073						WB2.login(function() {
1074						    WB2.anyWhere(function(W){
1075						   		console.log('wb2里面的access_token:',WB2.oauthData.access_token);
1076							    //数据交互
1077							    W.parseCMD('/account/get_uid.json', function(oResult, bStatus) {
1078							        if(bStatus) {
1079							           W.parseCMD('/users/show.json', function(oResult1, bStatus) {
1080									        if(bStatus) {
1081									            $.post(web.hostMap.host_pre+"user/signin/social",{openid:oResult1.id,source:'weibo',access_token:WB2.oauthData.access_token,system:'web'},function(data){
1082													if(data.success){
1083														if(data.user.bind&&data.user.bind>0){//第三方登陆用户已设置营地密码
1084															loginCallback({
1085																name:data.user.username,
1086																token:data.token,
1087																impassword:data.impassword,
1088																last:data.user.last,
1089																head:data.user.head,
1090																status:data.user.status,
1091																badge:data.user.badge,
1092																refresh_token:data.refresh_token,
1093																userid:data.user.id,
1094																userGroup:data.user.userGroup,
1095																userKey:data.user.userKey,
1096																phone:data.user.phone,
1097																fire:data.user.fire,
1098																credits:data.user.credits,
1099																is_vip: (data.user.vipId ? true : false)
1100															});
1101														}
1102														else{//第三方用户未设置密码
1103															$('.overlay').remove();//去除登录框遮罩层
1104															$('.login_frame').remove();//去除登录框
1105															thirdConfigPwd(data,data.user.phone);
1106														}
1107													}else{
1108														$('.overlay').remove();
1109														$('.login_frame').remove();
1110														if(web.user.register){
1111															web.user.register.weiboRegister(oResult1,WB2.oauthData.access_token);
1112														}
1113														else{
1114															$.getScript(web.hostMap.file_pre+"js/user/web.user.register.js?v="+new Date().getTime())
1115															.done(function(){
1116																web.user.register.weiboRegister(oResult1,WB2.oauthData.access_token);
1117															});
1118														}
1119														// web.user.register.weiboRegister(oResult1,WB2.oauthData.access_token);
1120													}
1121												},'json');
1122									        }
1123									    }, {
1124									        uid : oResult.uid
1125									    }, {
1126									        method : 'get',
1127									        cache_time : 30
1128									    });
1129							        }
1130							    }, {
1131							        // screen_name : '姚晨'
1132							    }, {
1133							        method : 'get',
1134							        cache_time : 30,
1135							    });
1136							});
1137						});
1138					}
1139				});
1140
1141				$('#login-switch').off().on('click',function (event) {
1142				    var $this,type;
1143				    $this=$(this);
1144				    type=$this.data('type'); //passWord qrCode
1145					qrCodeLogin.endPolling();
1146                    if(type==='qrCode'){
1147                        $this.data('type', 'passWord');
1148                        $this.children('img').attr('src', '' + configMap.image_url + 'yingdiWeb/images/user/login/pass.png');
1149                        $('.login_frame_content').addClass('hidden');
1150                        $('.login_frame_qrcode').removeClass('hidden');
1151                        qrCodeLogin.failQrCode();
1152					}
1153					else {
1154                        $this.data('type', 'qrCode');
1155                        $this.children('img').attr('src', '' + configMap.image_url + 'yingdiWeb/images/user/login/qr.png');
1156                        $('.login_frame_qrcode').addClass('hidden');
1157                        $('.login_frame_content').removeClass('hidden');
1158					}
1159				    configMap.destroyBubble(event);
1160                });
1161
1162				$('#gobackQrCode').off().on('click',function (event) {
1163					qrCodeLogin.failQrCode();
1164					configMap.destroyBubble(event);
1165				});
1166
1167				$('.login_frame .register').off().on('click', '#toRegister', function(){
1168					AnalysysAgent.track('web_user_register');
1169				})
1170			},
1171		};
1172
1173		findPwdModal = function(){//通过手机号找回密码
1174			$.gevent.publish('updatePageView',loginView.findPwd_html);
1175			$('.login-findPwd-frame .login-relatePwd-frame-infoInputItem input#user_phoneNum').focus();
1176			var temp_info = {};
1177			$('.login-findPwd-frame .login-relatePwd-frame-infoInputItem input#user_phoneNum').focus();
1178			$('.login-findPwd-frame .login-relatePwd-frame-infoInputItem input#user_phoneNum').blur(function(){//校验手机号
1179				var $this = $(this);
1180				var input_value = $this.val();
1181				if($this.closest('.login-relatePwd-frame-infoInputItem').find('.prompt-txt').length>0){
1182					if(input_value==''){
1183						$this.closest('.login-relatePwd-frame-infoInputItem').find('.prompt-txt').html('请填写手机号');
1184						$('#findPwd_send_check_code').attr('disabled','true');
1185					}
1186					else if(!(/^1[1-9]\d{9}$/.test(input_value))){
1187						$this.closest('.login-relatePwd-frame-infoInputItem').find('.prompt-txt').html('手机号码格式不正确');
1188						$('#findPwd_send_check_code').attr('disabled','true');
1189					}
1190					else{
1191						$.post(web.hostMap.host_pre+'common/check/phone',{phone:input_value},function(data){
1192							if(data.success){
1193								$this.closest('.login-relatePwd-frame-infoInputItem').find('.prompt-txt').html('该手机号没有被绑定');
1194								$('#findPwd_send_check_code').attr('disabled','true');
1195							}
1196							else{
1197								temp_info.user = data.user;
1198								$this.closest('.login-relatePwd-frame-infoInputItem').find('.prompt-txt').remove();
1199								$('#findPwd_send_check_code').removeAttr('disabled');
1200							}
1201						},'json');
1202					}
1203				}
1204				else{
1205					if(input_value==''){
1206						$this.closest('.login-relatePwd-frame-infoInputItem').append('<span class="prompt-txt">请填写手机号</span>');
1207						$('#findPwd_send_check_code').attr('disabled','true');
1208					}
1209					else if(!(/^1[1-9]\d{9}$/.test(input_value))){
1210						$this.closest('.login-relatePwd-frame-infoInputItem').append('<span class="prompt-txt">手机号码格式不正确</span>');
1211						$('#findPwd_send_check_code').attr('disabled','true');
1212					}
1213					else{
1214						$.post(web.hostMap.host_pre+'common/check/phone',{phone:input_value},function(data){
1215							if(data.success){
1216								$this.closest('.login-relatePwd-frame-infoInputItem').append('<span class="prompt-txt">该手机号没有被绑定</span>');
1217								$('#findPwd_send_check_code').attr('disabled','true');
1218							}
1219							else{
1220								temp_info.user = data.user;
1221								$this.closest('.login-relatePwd-frame-infoInputItem').find('.prompt-txt').remove();
1222								$('#findPwd_send_check_code').removeAttr('disabled');
1223							}
1224						},'json');
1225					}
1226				}
1227			});
1228			$('.login-findPwd-frame .login-relatePwd-frame-infoInputItem #findPwd_send_check_code').off().on('click',function(){//发送验证码
1229				var $this = $(this);
1230				var countDown = 120;
1231				var findPwd_url = window.location.href;
1232				var findPwd_activeBtn = function(){
1233					$('#findPwd_send_check_code').html(countDown+'秒后重发');
1234					countDown--;
1235					if(findPwd_url==window.location.href){
1236						if(countDown>0){
1237							setTimeoutItem = setTimeout(function(){findPwd_activeBtn()},1000);
1238						}
1239						else{
1240							$('#findPwd_send_check_code').html('发送验证码');
1241							$('#findPwd_send_check_code').removeClass('disabledBtn');
1242							$('#findPwd_send_check_code').removeAttr('disabled');
1243							countDown = 120;
1244							clearTimeout(setTimeoutItem);
1245						}
1246					}
1247					else{
1248						$('#findPwd_send_check_code').html('发送验证码');
1249						$('#findPwd_send_check_code').removeClass('disabledBtn');
1250						$('#findPwd_send_check_code').removeAttr('disabled');
1251						countDown = 120;
1252						clearTimeout(setTimeoutItem);
1253					}
1254				};
1255				if($this.closest('.login-relatePwd-frame-infoInputItem').find('.prompt-txt').length>0){
1256					if($this.closest('.login-relatePwd-frame-infoInputItem').prev().find('.prompt-txt').length>0){
1257						$this.closest('.login-relatePwd-frame-infoInputItem').prev().focus();
1258						web.utility.showBasicPrompt({
1259							content:'请按照要求填写手机号!',
1260							style:'alert-error'
1261						});
1262					}
1263					else{
1264						var phone = $('#user_phoneNum').val();
1265						if(phone&&phone.length>0){
1266							var timestamp = parseInt(new Date().getTime()/1000),
1267								appKey = 'e5Q5dMa32s1kyi87o5g1D3Fg1ku5O4RT',
1268								appSecret = 'W15Jyt87GH1m12rYUki4Fip87s5z142g1Ad4Ut64sR8t4JS54iYu87O7ps5RQ12g',
1269								signature = $.md5(appKey + appSecret + (timestamp%111111 + timestamp%654321) + phone).toUpperCase();
1270							$.post(web.hostMap.host_pre+'common/sms/send',{phone:phone,signature:signature,timestamp:timestamp,appKey:appKey},function(data){
1271								if(data.success){
1272									$this.attr('disabled','true');
1273									$this.addClass('disabledBtn');
1274									findPwd_activeBtn();
1275								}
1276								else{
1277									$this.closest('.login-relatePwd-frame-infoInputItem').find('.prompt-txt').html(data.msg);
1278								}
1279							},'json');
1280						}
1281						else{
1282							web.utility.showBasicPrompt({
1283								content:'请填写手机号!',
1284								style:'alert-error'
1285							});
1286						}
1287					}
1288				}
1289				else{
1290					if($this.closest('.register-frame-infoInputItem').prev().find('.prompt-txt').length>0){
1291						$this.closest('.login-relatePwd-frame-infoInputItem').prev().focus();
1292						web.utility.showBasicPrompt({
1293							content:'请按照要求填写手机号!',
1294							style:'alert-error'
1295						});
1296					}
1297					else{
1298						var phone = $('#user_phoneNum').val();
1299						if(phone&&phone.length>0){
1300							var timestamp = parseInt(new Date().getTime()/1000),
1301								appKey = 'e5Q5dMa32s1kyi87o5g1D3Fg1ku5O4RT',
1302								appSecret = 'W15Jyt87GH1m12rYUki4Fip87s5z142g1Ad4Ut64sR8t4JS54iYu87O7ps5RQ12g',
1303								signature = $.md5(appKey + appSecret + (timestamp%111111 + timestamp%654321) + phone).toUpperCase();
1304							$.post(web.hostMap.host_pre+'common/sms/send',{phone:phone,signature:signature,timestamp:timestamp,appKey:appKey},function(data){
1305								if(data.success){
1306									$this.attr('disabled','true');
1307									$this.addClass('disabledBtn');
1308									findPwd_activeBtn();
1309								}
1310								else{
1311									$this.closest('.login-relatePwd-frame-infoInputItem').append('<span class="prompt-txt">'+data.msg+'</span>');
1312								}
1313							},'json');
1314						}
1315						else{
1316							web.utility.showBasicPrompt({
1317								content:'请填写手机号!',
1318								style:'alert-error'
1319							});
1320						}
1321					}
1322				}
1323			});
1324			// $('.login-findPwd-frame .login-relatePwd-frame-infoInputItem input#check_code').focus(function(){
1325			// 	var phone = $('.login-findPwd-frame .login-relatePwd-frame-infoInputItem input#user_phoneNum').val();
1326			// 	if(!phone||phone==''){
1327			// 		$('.login-findPwd-frame .login-relatePwd-frame-infoInputItem input#user_phoneNum').focus();
1328			// 		web.utility.showBasicPrompt({
1329			// 			content:'请填写手机号!',
1330			// 			style:'alert-error'
1331			// 		});
1332			// 	}
1333			// });
1334			$('.login-findPwd-frame .login-relatePwd-frame-infoInputItem input#check_code').blur(function(){//校验验证码
1335				var $this = $(this);
1336				var input_value = $this.val();
1337				if($this.closest('.login-relatePwd-frame-infoInputItem').find('.prompt-txt').length>0){
1338					if(input_value==''){
1339						$this.closest('.login-relatePwd-frame-infoInputItem').find('.prompt-txt').html('请填写验证码');
1340					}
1341					else{
1342						$this.closest('.login-relatePwd-frame-infoInputItem').find('.prompt-txt').remove();
1343					}
1344				}
1345				else{
1346					if(input_value==''){
1347						$this.closest('.login-relatePwd-frame-infoInputItem').append('<span class="prompt-txt">请填写验证码</span>');
1348					}
1349					else{
1350						$this.closest('.login-relatePwd-frame-infoInputItem').find('.prompt-txt').remove();
1351					}
1352				}
1353			});
1354			$('#findPwdBtn').off().on('click',function(){
1355				var $findPwdBtn = $(this);
1356				if($('.login-relatePwd-frame-infoInputItem span.prompt-txt').length==0){
1357					var phone = $('.login-findPwd-frame input#user_phoneNum').val();
1358					var code = $('.login-findPwd-frame input#check_code').val();
1359					if(temp_info.user.id){
1360						$findPwdBtn.attr('disabled','true');
1361						$.post(web.hostMap.host_pre+'common/sms/user/verify',{user:temp_info.user.id,phone:phone,code:code},function(data){
1362							if(data.success){
1363								temp_info.access = data.access;
1364								$.gevent.publish('updatePageView',loginView.modifyPwd_html);
1365								$('.login-findPwd-frame .login-relatePwd-frame-infoInputItem input#user_password').blur(function(){//校验密码
1366									var $this = $(this);
1367									var input_value = $this.val();
1368									if($this.closest('.login-relatePwd-frame-infoInputItem').find('.prompt-txt').length>0){
1369										if(input_value==''){
1370											$this.closest('.login-relatePwd-frame-infoInputItem').find('.prompt-txt').html('请设置密码');
1371										}
1372										else if(input_value.length<8){
1373											$this.closest('.login-relatePwd-frame-infoInputItem').find('.prompt-txt').html('密码长度不够(不少于8位)');
1374										}
1375										else{
1376											$this.closest('.login-relatePwd-frame-infoInputItem').find('.prompt-txt').remove();
1377										}
1378									}
1379									else{
1380										if(input_value==''){
1381											$this.closest('.login-relatePwd-frame-infoInputItem').append('<span class="prompt-txt">请设置密码</span>');
1382										}
1383										else if(input_value.length<8){
1384											$this.closest('.login-relatePwd-frame-infoInputItem').append('<span class="prompt-txt">密码长度不够(不少于8位)</span>');
1385										}
1386										else{
1387											$this.closest('.login-relatePwd-frame-infoInputItem').find('.prompt-txt').remove();
1388										}
1389									}
1390								});
1391								$('.login-findPwd-frame .login-relatePwd-frame-infoInputItem input#confirm_password').blur(function(){//确定密码
1392									var $this = $(this);
1393									var input_value = $this.val();
1394									var prev_passwd = $('#user_password').val();
1395									if($this.closest('.login-relatePwd-frame-infoInputItem').find('.prompt-txt').length>0){
1396										if(input_value==''){
1397											$this.closest('.login-relatePwd-frame-infoInputItem').find('.prompt-txt').html('请再输入一次密码');
1398										}
1399										else if(input_value.length<8){
1400											$this.closest('.login-relatePwd-frame-infoInputItem').find('.prompt-txt').html('密码长度不够(不少于8位)');
1401										}
1402										else if(input_value!=prev_passwd){
1403											$this.closest('.login-relatePwd-frame-infoInputItem').find('.prompt-txt').html('密码不统一');
1404										}
1405										else{
1406											$this.closest('.login-relatePwd-frame-infoInputItem').find('.prompt-txt').remove();
1407										}
1408									}
1409									else{
1410										if(input_value==''){
1411											$this.closest('.login-relatePwd-frame-infoInputItem').append('<span class="prompt-txt">请再输入一次密码</span>');
1412										}
1413										else if(input_value.length<8){
1414											$this.closest('.login-relatePwd-frame-infoInputItem').append('<span class="prompt-txt">密码长度不够(不少于8位)</span>');
1415										}
1416										else if(input_value!=prev_passwd){
1417											$this.closest('.login-relatePwd-frame-infoInputItem').append('<span class="prompt-txt">密码不统一</span>');
1418										}
1419										else{
1420											$this.closest('.login-relatePwd-frame-infoInputItem').find('.prompt-txt').remove();
1421										}
1422									}
1423								});
1424								$('#modifyPwdBtn').off().on('click',function(){
1425									var $modifyPwdBtn = $(this);
1426									$modifyPwdBtn.attr('disabled','true');
1427									if($('.login-findPwd-frame .login-relatePwd-frame-infoInputItem span.prompt-txt').length==0){
1428										var new_password = $('.login-findPwd-frame #user_password').val();
1429										$.post(web.hostMap.host_pre+'common/update/password',{user:temp_info.user.id,password:new_password,access:temp_info.access},function(modify){
1430											if(modify.success){
1431												$.gevent.publish('updatePageView',loginView.modifyPwd_success_html);
1432												setTimeout(function(){
1433													toLogin();
1434												},2000);
1435											}
1436											else{
1437												web.utility.showBasicPrompt({
1438													content:data.msg,
1439													style:'alert-error'
1440												});
1441												$modifyPwdBtn.removeAttr('disabled');
1442											}
1443										},'json');
1444									}
1445									else{
1446										web.utility.showBasicPrompt({
1447											content:'有不符合要求的选项!',
1448											style:'alert-error'
1449										});
1450										$modifyPwdBtn.removeAttr('disabled');
1451									}
1452								});
1453							}
1454							else{
1455								web.utility.showBasicPrompt({
1456									content:data.msg,
1457									style:'alert-error'
1458								});
1459								$findPwdBtn.removeAttr('disabled');
1460							}
1461						},'json');
1462					}
1463				}
1464				else{
1465					web.utility.showBasicPrompt({
1466						content:'有不符合要求的选项!',
1467						style:'alert-error'
1468					});
1469				}
1470			});
1471		};
1472
1473		thirdConfigPwd = function(data,phone){//第三方老用户补充密码
1474			$.gevent.publish('updatePageView',loginView.thirdPwd_config_html);
1475			web.utility.addCSS(web.hostMap.file_pre+'js/jq/intlTelInput/css/intlTelInput.css');
1476			$.getScript(web.hostMap.file_pre+'js/jq/intlTelInput/js/utils.js')
1477			$.getScript(web.hostMap.file_pre+'js/jq/intlTelInput/js/intlTelInput.js').done(function(){
1478				$('#user_phoneNum').intlTelInput({
1479					placeholderNumberType: "MOBILE",
1480					preferredCountries: ['cn', 'hk', 'mo', 'tw'],
1481					utilsScript: web.hostMap.file_pre+'js/jq/intlTelInput/js/utils.js'
1482				});
1483			});
1484			$('.login-thirdPwdConfig-frame input#user_password').focus();
1485			var userInfo = data;
1486			if(phone&&phone.length>0){
1487				$('.login-thirdPwdConfig-frame .phoneNumArea').addClass('hidden');
1488			}
1489			else{
1490				$('.login-thirdPwdConfig-frame .phoneNumArea').removeClass('hidden');
1491				$('.login-thirdPwdConfig-frame .login-relatePwd-frame-infoInputItem input#user_phoneNum').blur(function(){//校验手机号
1492					var $this = $(this);
1493					var input_value = $this.val();
1494					if($this.closest('.login-relatePwd-frame-infoInputItem').find('.prompt-txt').length>0){
1495						if(input_value==''){
1496							$this.closest('.login-relatePwd-frame-infoInputItem').find('.prompt-txt').remove();
1497							$this.closest('.login-relatePwd-frame-infoInputItem').next().find('.prompt-txt').remove();
1498							$('#thirdPwdConfig_send_check_code').attr('disabled','true');
1499						}
1500						if($('#user_phoneNum').intlTelInput("isValidNumber")){
1501							var country_data = $('#user_phoneNum').intlTelInput("getSelectedCountryData");
1502							if(country_data&&country_data.dialCode!='86'){
1503								input_value = '00'+country_data.dialCode+input_value;
1504							}
1505							$.post(web.hostMap.host_pre+'common/check/phone',{phone:input_value},function(data){
1506								if(data.success){
1507									$this.closest('.login-relatePwd-frame-infoInputItem').find('.prompt-txt').remove();
1508									$('#thirdPwdConfig_send_check_code').removeAttr('disabled');
1509								}
1510								else{
1511									$this.closest('.login-relatePwd-frame-infoInputItem').find('.prompt-txt').html('该手机号已被绑定');
1512									$('#thirdPwdConfig_send_check_code').attr('disabled','true');
1513								}
1514							},'json');
1515						}
1516						else{
1517							$this.closest('.login-relatePwd-frame-infoInputItem').find('.prompt-txt').html('手机号码格式不正确');
1518						}
1519					}
1520					else{
1521						if(input_value==''){
1522							$this.closest('.login-relatePwd-frame-infoInputItem').find('.prompt-txt').remove();
1523							$this.closest('.login-relatePwd-frame-infoInputItem').next().find('.prompt-txt').remove();
1524							$('#thirdPwdConfig_send_check_code').attr('disabled','true');
1525						}
1526						if($('#user_phoneNum').intlTelInput("isValidNumber")){
1527							var country_data = $('#user_phoneNum').intlTelInput("getSelectedCountryData");
1528							if(country_data&&country_data.dialCode!='86'){
1529								input_value = '00'+country_data.dialCode+input_value;
1530							}
1531							$.post(web.hostMap.host_pre+'common/check/phone',{phone:input_value},function(data){
1532								if(data.success){
1533									$this.closest('.login-relatePwd-frame-infoInputItem').find('.prompt-txt').remove();
1534									$('#thirdPwdConfig_send_check_code').removeAttr('disabled');
1535								}
1536								else{
1537									$this.closest('.login-relatePwd-frame-infoInputItem').append('<span class="prompt-txt">该手机号已被绑定</span>');
1538									$('#thirdPwdConfig_send_check_code').attr('disabled','true');
1539								}
1540							},'json');
1541						}
1542						else{
1543							$this.closest('.login-relatePwd-frame-infoInputItem').append('<span class="prompt-txt">手机号码格式不正确</span>');
1544							$('#thirdPwdConfig_send_check_code').attr('disabled','true');
1545						}
1546					}
1547				});
1548				$('.login-thirdPwdConfig-frame .login-relatePwd-frame-infoInputItem #thirdPwdConfig_send_check_code').off().on('click',function(){//发送验证码
1549					var $this = $(this);
1550					var countDown = 120;
1551					var thirdPwdConfig_activeBtn = function(){
1552						$('#thirdPwdConfig_send_check_code').html(countDown+'秒后重发');
1553						countDown--;
1554						if(countDown>0){
1555							setTimeoutItem = setTimeout(function(){thirdPwdConfig_activeBtn()},1000);
1556						}
1557						else{
1558							$('#thirdPwdConfig_send_check_code').html('发送验证码');
1559							$('#thirdPwdConfig_send_check_code').removeClass('disabledBtn');
1560							$('#thirdPwdConfig_send_check_code').removeAttr('disabled');
1561							countDown = 120;
1562							clearTimeout(setTimeoutItem);
1563						}
1564					};
1565					if($this.closest('.login-relatePwd-frame-infoInputItem').find('.prompt-txt').length>0){
1566						if($this.closest('.login-relatePwd-frame-infoInputItem').prev().find('.prompt-txt').length>0){
1567							$this.closest('.login-relatePwd-frame-infoInputItem').prev().focus();
1568							web.utility.showBasicPrompt({
1569								content:'请按照要求填写手机号!',
1570								style:'alert-error'
1571							});
1572						}
1573						else{
1574							var phone = $('#user_phoneNum').val();
1575							if(phone&&phone.length>0){
1576								var country_data = $('#user_phoneNum').intlTelInput("getSelectedCountryData");
1577								if(country_data&&country_data.dialCode!='86'){
1578									phone = '00'+country_data.dialCode+phone;
1579								}
1580								var timestamp = parseInt(new Date().getTime()/1000),
1581									appKey = 'e5Q5dMa32s1kyi87o5g1D3Fg1ku5O4RT',
1582									appSecret = 'W15Jyt87GH1m12rYUki4Fip87s5z142g1Ad4Ut64sR8t4JS54iYu87O7ps5RQ12g',
1583									signature = $.md5(appKey + appSecret + (timestamp%111111 + timestamp%654321) + phone).toUpperCase();
1584								$.post(web.hostMap.host_pre+'common/sms/send',{phone:phone,signature:signature,timestamp:timestamp,appKey:appKey},function(data){
1585									if(data.success){
1586										$this.attr('disabled','true');
1587										$this.addClass('disabledBtn');
1588										thirdPwdConfig_activeBtn();
1589									}
1590									else{
1591										$this.closest('.login-relatePwd-frame-infoInputItem').find('.prompt-txt').html(data.msg);
1592									}
1593								},'json');
1594							}
1595							else{
1596								web.utility.showBasicPrompt({
1597									content:'请填写手机号!',
1598									style:'alert-error'
1599								});
1600							}
1601						}
1602					}
1603					else{
1604						if($this.closest('.login-relatePwd-frame-infoInputItem').prev().find('.prompt-txt').length>0){
1605							$this.closest('.login-relatePwd-frame-infoInputItem').prev().focus();
1606							web.utility.showBasicPrompt({
1607								content:'请按照要求填写手机号!',
1608								style:'alert-error'
1609							});
1610						}
1611						else{
1612							var phone = $('.login-thirdPwdConfig-frame #user_phoneNum').val();
1613							if(phone&&phone.length>0){
1614								var country_data = $('#user_phoneNum').intlTelInput("getSelectedCountryData");
1615								if(country_data&&country_data.dialCode!='86'){
1616									phone = '00'+country_data.dialCode+phone;
1617								}
1618								var timestamp = parseInt(new Date().getTime()/1000),
1619									appKey = 'e5Q5dMa32s1kyi87o5g1D3Fg1ku5O4RT',
1620									appSecret = 'W15Jyt87GH1m12rYUki4Fip87s5z142g1Ad4Ut64sR8t4JS54iYu87O7ps5RQ12g',
1621									signature = $.md5(appKey + appSecret + (timestamp%111111 + timestamp%654321) + phone).toUpperCase();
1622								$.post(web.hostMap.host_pre+'common/sms/send',{phone:phone,signature:signature,timestamp:timestamp,appKey:appKey},function(data){
1623									if(data.success){
1624										$this.attr('disabled','true');
1625										$this.addClass('disabledBtn');
1626										thirdPwdConfig_activeBtn();
1627									}
1628									else{
1629										$this.closest('.login-relatePwd-frame-infoInputItem').append('<span class="prompt-txt">'+data.msg+'</span>');
1630									}
1631								},'json');
1632							}
1633							else{
1634								web.utility.showBasicPrompt({
1635									content:'请填写手机号!',
1636									style:'alert-error'
1637								});
1638							}
1639						}
1640					}
1641				});
1642				$('.login-thirdPwdConfig-frame .login-relatePwd-frame-infoInputItem input#check_code').focus(function(){
1643					var phone = $('.login-thirdPwdConfig-frame .login-relatePwd-frame-infoInputItem input#user_phoneNum').val();
1644					if(!phone||phone==''){
1645						web.utility.showBasicPrompt({
1646							content:'请填写手机号!',
1647							style:'alert-error'
1648						});
1649					}
1650				});
1651				$('.login-thirdPwdConfig-frame .login-relatePwd-frame-infoInputItem input#check_code').blur(function(){//校验验证码
1652					var $this = $(this);
1653					var input_value = $this.val();
1654					if($this.closest('.login-relatePwd-frame-infoInputItem').find('.prompt-txt').length>0){
1655						if(input_value==''){
1656							$this.closest('.login-relatePwd-frame-infoInputItem').find('.prompt-txt').html('请填写验证码');
1657						}
1658						else{
1659							$this.closest('.login-relatePwd-frame-infoInputItem').find('.prompt-txt').remove();
1660						}
1661					}
1662					else{
1663						if(input_value==''){
1664							$this.closest('.login-relatePwd-frame-infoInputItem').append('<span class="prompt-txt">请填写验证码</span>');
1665						}
1666						else{
1667							$this.closest('.login-relatePwd-frame-infoInputItem').find('.prompt-txt').remove();
1668						}
1669					}
1670				});
1671			}
1672			$('.login-thirdPwdConfig-frame .login-relatePwd-frame-infoInputItem input#user_password').blur(function(){//校验密码
1673				var $this = $(this);
1674				var input_value = $this.val();
1675				if($this.closest('.login-relatePwd-frame-infoInputItem').find('.prompt-txt').length>0){
1676					if(input_value==''){
1677						$this.closest('.login-relatePwd-frame-infoInputItem').find('.prompt-txt').html('请设置密码');
1678					}
1679					else if(input_value.length<8){
1680						$this.closest('.login-relatePwd-frame-infoInputItem').find('.prompt-txt').html('密码长度不够(不少于8位)');
1681					}
1682					else{
1683						$this.closest('.login-relatePwd-frame-infoInputItem').find('.prompt-txt').remove();
1684					}
1685				}
1686				else{
1687					if(input_value==''){
1688						$this.closest('.login-relatePwd-frame-infoInputItem').append('<span class="prompt-txt">请设置密码</span>');
1689					}
1690					else if(input_value.length<8){
1691						$this.closest('.login-relatePwd-frame-infoInputItem').append('<span class="prompt-txt">密码长度不够(不少于8位)</span>');
1692					}
1693					else{
1694						$this.closest('.login-relatePwd-frame-infoInputItem').find('.prompt-txt').remove();
1695					}
1696				}
1697			});
1698			$('.login-thirdPwdConfig-frame .login-relatePwd-frame-infoInputItem input#confirm_password').blur(function(){//确定密码
1699				var $this = $(this);
1700				var input_value = $this.val();
1701				var prev_passwd = $('#user_password').val();
1702				if($this.closest('.login-relatePwd-frame-infoInputItem').find('.prompt-txt').length>0){
1703					if(input_value==''){
1704						$this.closest('.login-relatePwd-frame-infoInputItem').find('.prompt-txt').html('请再输入一次密码');
1705					}
1706					else if(input_value.length<8){
1707						$this.closest('.login-relatePwd-frame-infoInputItem').find('.prompt-txt').html('密码长度不够(不少于8位)');
1708					}
1709					else if(input_value!=prev_passwd){
1710						$this.closest('.login-relatePwd-frame-infoInputItem').find('.prompt-txt').html('密码不统一');
1711					}
1712					else{
1713						$this.closest('.login-relatePwd-frame-infoInputItem').find('.prompt-txt').remove();
1714					}
1715				}
1716				else{
1717					if(input_value==''){
1718						$this.closest('.login-relatePwd-frame-infoInputItem').append('<span class="prompt-txt">请再输入一次密码</span>');
1719					}
1720					else if(input_value.length<8){
1721						$this.closest('.login-relatePwd-frame-infoInputItem').append('<span class="prompt-txt">密码长度不够(不少于8位)</span>');
1722					}
1723					else if(input_value!=prev_passwd){
1724						$this.closest('.login-relatePwd-frame-infoInputItem').append('<span class="prompt-txt">密码不统一</span>');
1725					}
1726					else{
1727						$this.closest('.login-relatePwd-frame-infoInputItem').find('.prompt-txt').remove();
1728					}
1729				}
1730			});
1731
1732			$('#configThirdPwd').off().on('click',function(){
1733				var $configThirdPwd = $(this);
1734				$configThirdPwd.attr('disabled','true');
1735				if($('.login-thirdPwdConfig-frame .login-relatePwd-frame-infoInputItem span.prompt-txt').length==0){
1736					var new_password = $('.login-thirdPwdConfig-frame input#user_password').val();
1737					var phoneNo = $('.login-thirdPwdConfig-frame input#user_phoneNum').val();
1738					var code = $('.login-thirdPwdConfig-frame input#check_code').val();
1739					if(phoneNo&&phoneNo.length>0){//如果用户绑定了手机
1740						var country_data = $('#user_phoneNum').intlTelInput("getSelectedCountryData");
1741						if(country_data&&country_data.dialCode!='86'){
1742							phoneNo = '00'+country_data.dialCode+phoneNo;
1743						}
1744						$.post(web.hostMap.host_pre+'common/sms/verify',{user:userInfo.user.id,phone:phoneNo,code:code},function(verify){
1745							if(verify.success){
1746								$.post(web.hostMap.host_pre+'user/'+userInfo.user.id+'/update',{token:userInfo.token,password:new_password,phone:phoneNo,phoneStatus:1},function(configpwd){
1747									if(configpwd.success){
1748										$.gevent.publish('updatePageView',loginView.thirdPwd_config_success_html);
1749										setTimeout(function(){
1750											window.location.href = '/';
1751										},2000);
1752									}
1753								},'json');
1754							}
1755							else{
1756								web.utility.showBasicPrompt({
1757									content:'验证错误!'+verify.msg,
1758									style:'alert-error'
1759								});
1760								$configThirdPwd.removeAttr('disabled');
1761							}
1762						},'json');
1763					}
1764					else{//用户未绑定手机
1765						$.post(web.hostMap.host_pre+'user/'+userInfo.user.id+'/update',{token:userInfo.token,password:new_password},function(configpwd){
1766							if(configpwd.success){
1767								$.gevent.publish('updatePageView',loginView.thirdPwd_config_success_html);
1768								setTimeout(function(){
1769									window.location.href = '/';
1770								},2000);
1771							}
1772							else{
1773								web.utility.showBasicPrompt({
1774									content:data.msg,
1775									style:'alert-error'
1776								});
1777								$configThirdPwd.removeAttr('disabled');
1778							}
1779						},'json')
1780					}
1781				}
1782				else{
1783					web.utility.showBasicPrompt({
1784						content:'有不符合要求的选项!',
1785						style:'alert-error'
1786					});
1787					$configThirdPwd.removeAttr('disabled');
1788				}
1789			});
1790		};
1791
1792		toLogout = function(logout_func){//退出登录
1793			var user = web.user.getUser();
1794			util.unsetCookie({name:'refreshToken'});
1795			util.unsetCookie({name:'user'});
1796			util.unsetCookie({name:'userid'});
1797			util.unsetCookie({name:'token'});
1798			// util.unsetCookie({name:'access'});
1799			util.unsetCookie({name:'last'});
1800			util.unsetCookie({name:'headimage'});
1801			util.unsetCookie({name:'phone'});
1802			util.unsetCookie({name:'impassword'});
1803			util.unsetCookie({name:'status'});
1804			util.unsetCookie({name:'userGroup'});
1805			util.unsetCookie({name:'userKey'});
1806
1807			if(WB2.checkLogin()){
1808				WB2.logout(function(){});
1809			}
1810			if(QC.Login.check()){
1811				QC.Login.signOut();
1812			}
1813
1814			if(logout_func&&$.type(logout_func)=='function'){
1815				logout_func();
1816			}
1817
1818			if(window.location.pathname.split('/').indexOf('personal')>=0){
1819				$.gevent.publish('getPageByUrl','/');
1820			}
1821			else if(window.location.pathname.split('/').indexOf('contribute')>=0){
1822				$.gevent.publish('getPageByUrl','/');
1823			}
1824			else if(window.location.pathname.split('/').indexOf('admin')>=0){
1825				$.gevent.publish('getPageByUrl','/');
1826			}
1827			else if(window.location.pathname.split('/').indexOf('follows')>=0){
1828				$.gevent.publish('getPageByUrl','/');
1829			}
1830			else{
1831				$.gevent.publish('getPageByUrl',window.location.href);
1832			}
1833		};
1834
1835		toLogin = function(){//弹出登陆框开始登录
1836			AnalysysAgent.track('web_user_login');
1837			if(navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.match(/8./i)=="8."){
1838				util.appendPage({
1839					page_html:loginView.ie_html,
1840					page_id:null,
1841					callback:loginView.callback
1842				});
1843			} else if(navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.match(/9./i)=="9."){
1844				util.appendPage({
1845					page_html:loginView.ie_html,
1846					page_id:null,
1847					callback:loginView.callback
1848				});
1849			} else{
1850				util.appendPage({
1851					page_html:loginView.normal_html,
1852					page_id:null,
1853					callback:loginView.callback
1854				});
1855			}
1856		};
1857
1858		//二维码登录使用
1859        qrCodeLogin = {
1860            Timer:null,
1861            getGuId: function () {
1862                var S4, guid;
1863                S4 = function () {
1864                    return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1);
1865                }
1866                guid = (S4() + S4() + S4() + S4() + S4() + S4() + S4() + S4());
1867                return guid;
1868            },
1869            getQrImage: function () {
1870                var guid,$qrcodeImg;
1871                $qrcodeImg=$('.login_frame_qrcode .photo .image > img');
1872                $qrcodeImg.attr('src', '' + configMap.image_url + 'yingdiWeb/images/user/login/qr-loading.png');
1873                guid = this.getGuId();
1874                $.ajax({
1875                    type: 'POST',
1876                    url: web.hostMap.host_pre + 'user/qr/code',
1877                    data: {qr: guid},
1878                    datatype: 'json',
1879                    success: function (data) {
1880                        if (data.success) {
1881                            $qrcodeImg.attr('src', 'https://api.qrserver.com/v1/create-qr-code/?size=163x163&data=' + guid + '');
1882                            qrCodeLogin.getScanState(guid);
1883                        }
1884                    }
1885                });
1886            },
1887            getScanState: function (guid) {
1888                var timestamp = parseInt(new Date().getTime() / 1000),
1889                    appKey = 'e5Q5dMa32s1kyi87o5g1D3Fg1ku5O4RT',
1890                    appSecret = 'W15Jyt87GH1m12rYUki4Fip87s5z142g1Ad4Ut64sR8t4JS54iYu87O7ps5RQ12g',
1891                    signature = $.md5(appKey + appSecret + (timestamp % 111111 + timestamp % 654321) + guid).toUpperCase(),
1892                    polling;
1893                polling = function () {
1894                    qrCodeLogin.Timer = setTimeout(function () {
1895                        $.ajax({
1896                            type: 'GET',
1897                            url: web.hostMap.host_pre + 'user/qr/check',
1898                            data: {qr: guid, signature: signature, timestamp: timestamp, appKey: appKey},
1899                            datatype: 'json',
1900                            success: function (data) {
1901                                switch (data.status) {
1902                                    case 0: //未使用
1903                                        polling();
1904                                        break;
1905                                    case 1: //成功
1906                                        loginCallback({
1907                                            name: data.user.username,
1908                                            token: data.token,
1909                                            impassword: data.impassword,
1910                                            last: data.user.last,
1911                                            head: data.user.head,
1912                                            status: data.user.status,
1913                                            badge: data.user.badge,
1914                                            refresh_token: data.refresh_token,
1915                                            userid: data.user.id,
1916                                            userGroup: data.user.userGroup,
1917											userKey: data.user.userKey,
1918											fire:data.user.fire,
1919											credits:data.user.credits,
1920											is_vip: (data.user.vipId ? true : false)
1921                                        });
1922                                        qrCodeLogin.endPolling();
1923                                        break;
1924                                    case 2: //扫描
1925                                        polling();
1926                                        qrCodeLogin.scanQrCode();
1927                                        break;
1928                                    case 3: //失效
1929                                        qrCodeLogin.failQrCode();
1930                                        break;
1931                                }
1932                            }
1933                        });
1934                    }, 2000);
1935                };
1936                polling();
1937            },
1938            scanQrCode: function () {
1939                var $photo, $result;
1940                $photo = $('.login_frame_qrcode .photo');
1941                $result = $('.login_frame_qrcode .result');
1942                $photo.addClass('hidden');
1943                $result.removeClass('hidden');
1944            },
1945            failQrCode: function () { //失效,取消,返回都可使用此方法
1946                var $photo, $result;
1947                $photo = $('.login_frame_qrcode .photo');
1948                $result = $('.login_frame_qrcode .result');
1949                $photo.removeClass('hidden');
1950                $result.addClass('hidden');
1951                qrCodeLogin.endPolling();
1952                qrCodeLogin.getQrImage();
1953            },
1954            endPolling: function () {
1955                clearTimeout(qrCodeLogin.Timer);
1956            }
1957		};
1958		initModule = function(arg_array,pageid){
1959			clearTimeout(setTimeoutItem);
1960			if(!arg_array||arg_array.length==0){
1961				var user = web.user.getUser(),
1962					code = GetQueryString('code');
1963				if(code){
1964					util.weixinLogin();
1965				}
1966				else if(user.name&&web.user.getUser('refreshToken')){//如果有登陆的cookie
1967					$.post(web.hostMap.host_pre+'user/token/refresh',{refresh_token:util.getCookie('refreshToken')},function(data){
1968						if(data.success){
1969							var token_date = new Date(new Date().getTime()+23*60*60*1000);
1970							util.setCookie({
1971								name:'token',
1972								value:data.token,
1973								expires:token_date
1974							});
1975							changeNav(user,'login','init');//改变导航栏用户登陆样式
1976							util.sdkLogin(user.name,user.impassword,'init');//登陆即时通讯
1977						}
1978						else{
1979							util.unsetCookie({name:'refreshToken'});
1980							changeNav(user,'logout');
1981							// $.gevent.publish('getPageByUrl',null);
1982						}
1983					},'json');
1984				}
1985				else{
1986					changeNav(user,'logout');
1987				}
1988			}
1989			else if(arg_array&&arg_array.length==1){
1990				if(arg_array[0]=='findPwd'){
1991					$('.overlay').remove();//去除登录框遮罩层
1992					$('.login_frame').remove();//去除登录框
1993					findPwdModal();
1994				}
1995				else if(arg_array[0]=='weixin'&&code){//微信特殊处理,需要code
1996					util.weixinLogin();
1997				}
1998			}
1999		};
2000
2001		return {
2002			initModule:initModule,
2003			toLogin:toLogin,
2004			toLogout:toLogout,
2005			loginCallback:loginCallback,
2006			util:util,
2007		}
2008
2009	}());

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.