Browse Source

修改,已绑定的邮箱,隐藏“@”前4位字符,显示为“*”号;

xuchunyang 8 years ago
parent
commit
85bb0e3bda
1 changed files with 29 additions and 3 deletions
  1. 29 3
      js/account-set.js

+ 29 - 3
js/account-set.js

@ -2,8 +2,8 @@ $(function(){
2 2
	
3 3
	    loginStatus();//读取用户头像
4 4
	    valUser();
5
	   
6 5
	    var setta = GetQueryString("seta");
6
	
7 7
		if(setta==2){
8 8
			$(".account-set a").eq(1).addClass("bgcolor").siblings().removeClass("bgcolor");
9 9
			$(".contentbox .content-set").eq(1).show().siblings().hide();
@ -75,7 +75,9 @@ $(function(){
75 75
		var emailCookie = $.cookie("userEmail");
76 76
		var phoneCookie = $.cookie("userMobilePhone");
77 77
		if(emailCookie != "" && emailCookie != null && emailCookie != "null" ){
78
			$("#emailShow").text(emailCookie);
78
		    //alert(emailCookieshow);
79
		    emailhome(emailCookie);
80
		    $("#emailShow").text(emailCookieshow);
79 81
			$(".replace1").hide();	
80 82
			$(".replace3").show();		
81 83
		}else{
@ -91,6 +93,29 @@ $(function(){
91 93
			$(".replace2").show();	
92 94
			$(".replace4").hide();		
93 95
		}
96
		
97
		function emailhome(emailset){
98
			//var emailCookieshow;
99
			var  emailq = emailset.replace(/@.*/, "");
100
		    var  emailh = emailset.replace(emailq, "");
101
		    if(emailq.length>=6){
102
		    	emailCookieshow = emailq.substring(emailq.length-4, 0) + "****" + emailh;
103
		    }
104
		    if(emailq.length==5){
105
		    	emailCookieshow = emailq.substring(emailq.length-3, 0) + "***" + emailh;
106
		    }
107
		    if(emailq.length==4){
108
		    	emailCookieshow = emailq.substring(emailq.length-2, 0) + "**" + emailh;
109
		    }
110
		    if(emailq.length==3){
111
		    	emailCookieshow = emailq.substring(emailq.length-1, 0) + "*" + emailh;
112
		    }
113
		    if(emailq.length<3){
114
		    	emailCookieshow = emailq+emailh;
115
		    }
116
		    return emailCookieshow;
117
		}
118

94 119

95 120
	var oldPass = false;
96 121
	var isPass = false;
@ -250,8 +275,9 @@ $(function(){
250 275
					console.log(data)
251 276
					 $.MsgBox.Alert('消息提醒','邮箱绑定成功')
252 277
					 var emaild = data.data.email;
278
					 emailhome(emaild);
253 279
					 $.cookie('userEmail',emaild,{path:"/"});
254
					 $("#emailShow").text(emaild);
280
					 $("#emailShow").text(emailCookieshow);
255 281
				},
256 282
				error:function(){
257 283
				   $.MsgBox.Alert('消息提醒','邮箱绑定失败')