Browse Source

买家中心 账户管理新页面整合

liusw 8 years ago
parent
commit
d232f0689b

+ 4 - 1
src/main/java/com/uas/platform/b2c/common/account/controller/AuthenticationController.java

@@ -37,7 +37,10 @@ public class AuthenticationController {
 		List<UserQuestion> userQuestion = userQuestionService.findUserQuestionByUserUUOrderBySortAsc(SystemSession.getUser().getUserUU());
 		UserInfo userInfo = new UserInfo(SystemSession.getUser());
 		if(userQuestion!=null){
-			userInfo.setHaveUserQuestion(userQuestion.size()>0?true:false);
+			if(userQuestion.size()>0){
+				userInfo.setHaveUserQuestion(true);
+				userInfo.setSecLevel((short)(1+userInfo.getSecLevel()));
+			}
 		}
 		return userInfo;
 	}

+ 21 - 7
src/main/java/com/uas/platform/b2c/common/account/controller/UserController.java

@@ -18,6 +18,7 @@ import com.uas.platform.core.util.encry.Md5Utils;
 import com.uas.platform.core.util.serializer.FlexJsonUtils;
 import com.wordnik.swagger.annotations.ApiOperation;
 import com.wordnik.swagger.annotations.ApiParam;
+import org.apache.http.protocol.HTTP;
 import org.jboss.logging.annotations.Param;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.domain.Page;
@@ -111,14 +112,21 @@ public class UserController {
 	 * @param password	用户输入密码
 	 */
 	@RequestMapping(value = "/updatePassword", method = RequestMethod.POST)
-	public ResponseEntity<String> updatePassword(final HttpSession session, final String password, final String newPassword) {
+	public ResponseEntity<String> updatePassword(final HttpSession session, final String password, final String newPassword,final Short secLevel) {
 		if (password.equals(newPassword)) {
 			throw new IllegalOperatorException("新密码与旧密码相同");
 		}
+		if(newPassword.length()<8 || "^[0-9]*$".matches(newPassword) || "^[A-Za-z]*$".matches(newPassword)){
+			throw new IllegalOperatorException("密码强度不够,请重新输入");
+		}
+		if(newPassword.length()>20){
+			throw new IllegalOperatorException("密码超过20位,请重新输入");
+		}
 		User sysUser = SystemSession.getUser();
 		User user = userService.findUserPwdByUserUU(sysUser.getUserUU());
 		Enterprise enterprise = user.getEnterprise();
 		if (!StringUtils.isEmpty(newPassword)) {
+			user.setPwdSecLevel(secLevel);
 			user = userService.updatePassword(user, password, newPassword);
 			user.setEnterprise(enterprise);
 			session.setAttribute("user", user);
@@ -224,7 +232,7 @@ public class UserController {
 	 */
 	@RequestMapping(value = "/updateUserEmail", method = RequestMethod.POST)
 	public ResponseEntity<String> updateUserEmail(final HttpSession session, final String userEmail, final String newUserEmail) {
-		if (userEmail.equals(newUserEmail)) {
+		if (userEmail!=null && userEmail.equals(newUserEmail)) {
 			throw new IllegalOperatorException("新邮箱地址与旧邮箱地址相同");
 		}
 		User sysUser = SystemSession.getUser();
@@ -233,6 +241,9 @@ public class UserController {
 			if (!userService.isEmailUseable(newUserEmail)) {
 				throw new IllegalOperatorException("邮箱已被注册...");
 			}
+			if(userEmail!=null && !userEmail.equals(user.getUserEmail())){
+				throw new IllegalOperatorException("旧邮箱地址校验错误");
+			}
 			user.setUserEmail(newUserEmail);
 			user = userService.save(user);
 			session.setAttribute("user", user);
@@ -462,14 +473,16 @@ public class UserController {
 	 * @return
 	 */
 	@RequestMapping(value = "/updateRealAuth", method = RequestMethod.POST)
-	public ResponseEntity<String> updateRealAuth(final String userName, final String userIdcode, final String idImgUrl) {
+	public ResponseEntity<String> updateRealAuth(final String userName, final String userIdcode, final String idImgUrl,HttpServletRequest request) {
 		User sysUser = SystemSession.getUser();
 		sysUser.setUserName(userName);
 		sysUser.setUserIccode(userIdcode);
 		sysUser.setIdImgUrl(idImgUrl);
 		sysUser.setIdEnable((short)2);
 		sysUser.setIdDate(new Date());
-		userService.saveRealAuth(sysUser);
+		sysUser = userService.saveRealAuth(sysUser);
+		request.getSession().setAttribute("user",sysUser);
+		SystemSession.setUser(sysUser);
 		return new ResponseEntity<>(HttpStatus.OK);
 	}
 
@@ -575,7 +588,7 @@ public class UserController {
 			throw new IllegalOperatorException("手机号不能为空!");
 		} else {
 			HttpHeaders headers = new HttpHeaders();
-			headers.add("Content-Type", "application/json; charset=utf-8");
+			headers.add("Content-Type", "application/text; charset=utf-8");
 			return new ResponseEntity<Boolean>(userService.isTelUseable(tel.replaceAll("\\s*", "")), headers,
 					HttpStatus.OK);
 		}
@@ -629,9 +642,10 @@ public class UserController {
 	 * @param user
 	 * @return
 	 */
-	@RequestMapping(value = "/updateIdEnable", method = RequestMethod.GET)
-	public ResponseEntity<String> updateIdEnable(final User user) {
+	@RequestMapping(value = "/updateIdEnable", method = RequestMethod.POST)
+	public ResponseEntity<String> updateIdEnable(final User user,HttpServletRequest request) {
 		User newUser = userService.saveRealAuth(user);
+		request.getSession().setAttribute("user",newUser);
 		SystemSession.setUser(newUser);
 		return new ResponseEntity<String>(HttpStatus.OK);
 	}

+ 11 - 0
src/main/java/com/uas/platform/b2c/common/account/model/User.java

@@ -189,6 +189,17 @@ public class User implements Serializable {
 	@Column(name = "user_pwdseclevel")
 	private Short pwdSecLevel;
 
+	@Column(name = "user_lastlogintime")
+	private Long lastLoginTime;
+
+	public Long getLastLoginTime() {
+		return lastLoginTime;
+	}
+
+	public void setLastLoginTime(Long lastLoginTime) {
+		this.lastLoginTime = lastLoginTime;
+	}
+
 	public Short getPwdSecLevel() {
 		return pwdSecLevel;
 	}

+ 14 - 2
src/main/java/com/uas/platform/b2c/common/account/model/UserInfo.java

@@ -51,8 +51,10 @@ public class UserInfo {
 			}
 			this.enterprises = list;
 		}
-		this.havePayPwd = user.getUserPay()==null?false:true;
+		this.havePayPwd = user.getUserPay()==null || user.getUserPay().equals("") ?false:true;
 		this.idEnable = user.getIdEnable()==null?0:user.getIdEnable();
+		this.haveUserQuestion = haveUserQuestion;
+		this.lastLoginTime = user.getLastLoginTime();
 		this.secLevel = countSecLevel();
 	}
 
@@ -73,7 +75,7 @@ public class UserInfo {
 		if(getUserTel()!=null){
 			count++;
 		}
-		if(isHavePayPwd()){
+		if(isHaveUserQuestion()){
 			count++;
 		}
 		return count;
@@ -115,6 +117,16 @@ public class UserInfo {
 
 	private Short secLevel;
 
+	private Long lastLoginTime;
+
+	public Long getLastLoginTime() {
+		return lastLoginTime;
+	}
+
+	public void setLastLoginTime(Long lastLoginTime) {
+		this.lastLoginTime = lastLoginTime;
+	}
+
 	public Short getSecLevel() {
 		return secLevel;
 	}

+ 23 - 15
src/main/java/com/uas/platform/b2c/common/account/service/impl/UserServiceImpl.java

@@ -275,12 +275,12 @@ public class UserServiceImpl implements UserService {
 				user1.setCurrentEnterprise();// 随便绑定一个用户所属企业
 			Enterprise enterprise = user1.getEnterprise();
 			try {
-                //判断是否为个人账户
-                if (enterprise == null){
-                    AccountUtils.resetPassword(user1.getUserUU(), null, newPassword);
-                }else {
-                    AccountUtils.resetPassword(user1.getUserUU(), enterprise.getUu(), newPassword);
-                }
+					//判断是否为个人账户
+					if (enterprise == null){
+							AccountUtils.resetPassword(user1.getUserUU(), null, newPassword);
+					}else {
+							AccountUtils.resetPassword(user1.getUserUU(), enterprise.getUu(), newPassword);
+					}
 				//user1 = userDao.save(user1);
 			} catch (Exception e) {
 				throw new SystemException(e.getMessage());
@@ -385,21 +385,28 @@ public class UserServiceImpl implements UserService {
 	public User updateUserPay(User user, String userPay, String newUserPay) {
 		boolean result =false;
 		User user1 = userDao.findOne(user.getUserUU());
-		//未设置则不需要验证密码
-		if(user1.getUserPay()!=null){
-			result = user.getUserPay().equals(Md5Utils.encode(userPay, user.getUserUU()));
-		}
 		//未设置和验证成功
-		if (user1.getUserPay()==null || result) {
+		if (user1.getUserPay()==null || user1.getUserPay().equals("")) {
 			user1.setUserPay(Md5Utils.encode(newUserPay, user1.getUserUU()));
 			try {
-				userDao.save(user1);
+				user1 = userDao.save(user1);
 			} catch (Exception e) {
 				throw new SystemException(e.getMessage());
 			}
 			return user1;
-		} else {
-			throw new IllegalOperatorException("原密码验证错误");
+		}else{//需要验证密码
+			result = user1.getUserPay().equals(Md5Utils.encode(userPay, user.getUserUU()));
+			if(result){
+				user1.setUserPay(Md5Utils.encode(newUserPay, user1.getUserUU()));
+				try {
+					user1 = userDao.save(user1);
+				} catch (Exception e) {
+					throw new SystemException(e.getMessage());
+				}
+				return user1;
+			}else{
+				throw new IllegalOperatorException("原密码验证失败");
+			}
 		}
 	}
 
@@ -409,7 +416,8 @@ public class UserServiceImpl implements UserService {
 		if(sysUser==null){
 			throw new IllegalOperatorException("找不到用户");
 		}
-		return userDao.save(user);
+		sysUser.setIdEnable(user.getIdEnable());
+		return userDao.save(sysUser);
 	}
 
 	@Override

+ 3 - 0
src/main/java/com/uas/platform/b2c/common/account/v2/service/impl/UserServiceImpl.java

@@ -38,6 +38,9 @@ public class UserServiceImpl implements UserService {
         u.setEnable((short) 1);
         u.setUserEmail(user.getSecondUID());
         u.setUserUU(Long.valueOf(user.getDialectUID()));
+        //添加密码强度以及最后一次登录时间
+        u.setPwdSecLevel(user.getPwdSecLevel());
+        u.setLastLoginTime(user.getLastLoginTime());
         Enterprise enterprise = enterpriseDao.findByUu(Long.valueOf(user.getSpaceDialectUID()));
         if(null != enterprise) {
             u.setEnterprise(enterprise);

+ 1 - 2
src/main/webapp/resources/js/admin/controllers/AuditRealAuthCtrl.js

@@ -23,8 +23,7 @@ define(['app/app'], function (app) {
     });
 
     $scope.updateIdEnable = function(idEnable,info){
-        info.idEnable = idEnable;
-        User.updateIdEnable(info,function(data){
+        User.updateIdEnable({userUU:info.userUU,idEnable:idEnable},{},function(data){
             location.reload();
         },function(response){
 

+ 1 - 1
src/main/webapp/resources/js/common/query/user.js

@@ -151,7 +151,7 @@ define([ 'angular', 'ui-bootstrap', 'ngResource' ], function(angular) {
 			},
 			updateIdEnable:{
         url: 'basic/user/updateIdEnable',
-        method: 'GET'
+        method: 'POST'
 			},
 			getAllSecQuestion:{
 				url:'user/secQuestion/getPageInfo',

+ 64 - 11
src/main/webapp/resources/js/usercenter/controllers/forstore/account_manager_ctrl.js

@@ -9,6 +9,10 @@ define(['app/app'], function(app) {
 		$scope.userInfo = $rootScope.userInfo;
 		$scope.userInfoBackup = angular.copy($scope.userInfo);
 		$scope.canAddTotal = 20;
+		//手机号和邮箱号的部分隐藏
+	  $scope.userInfo.userTel = $scope.userInfo.userTel.substr(0, 3) + '****' + $scope.userInfo.userTel.substr(7);
+	  var userEmailTemp = $scope.userInfo.userEmail.indexOf("@");
+    $scope.userInfo.userEmail = $scope.userInfo.userEmail.substr(0,userEmailTemp-2)+"***"+$scope.userInfo.userEmail.substr(userEmailTemp);
 		// 获取企业信息
 		if ($scope.userInfo.enterprise) {
 			Enterprise.getEnterpriseInfo({enuu : $scope.userInfo.enterprise.uu}, function(data) {
@@ -545,6 +549,29 @@ define(['app/app'], function(app) {
 				}
 		}
 
+		//密码强度校验
+		$scope.secLevel = 0;
+		$scope.checkPasswordLevel = function (newPassword){
+			$scope.checkFailed1 = false;
+      if(newPassword==null){
+        $scope.secLevel = 0;
+        return;
+      }
+				//不足8位,或仅有数字,或仅有英文
+			if(newPassword.length<8 || /^[0-9]*$/.test(newPassword) || /^[A-Za-z]*$/.test(newPassword)){
+        $scope.secLevel = 1;
+        return;
+      }
+      if(/^[A-Z0-9]{8,20}$/.test(newPassword) || /^[a-z0-9]{8,20}$/.test(newPassword)){//达到8位,且 仅有数字+英文小写 或 仅有数字+英文大写
+        $scope.secLevel = 2;
+        return;
+			}
+			if(/^(?=.*[0-9].*)(?=.*[A-Z].*)(?=.*[a-z].*).{8,20}$/.test(newPassword)){
+        $scope.secLevel = 3;
+        return;
+			}
+		}
+
     //校验确认密码是否与新密码相同
     $scope.checkSuccess2 = false;
     $scope.checkFailed2 = false;
@@ -564,8 +591,12 @@ define(['app/app'], function(app) {
 				toaster.pop('error', '错误', '新密码与原密码相同');
 				return;
 			}
+			if($scope.secLevel<=1){
+        toaster.pop('error', '错误', '密码强度不够,请重新输入');
+        return;
+			}
 			if($scope.user.newPassword == $scope.user.newPassword1) {//验证重复密码相等
-				User.updatePassword({password: $scope.user.password, newPassword: $scope.user.newPassword}, {}, function(){
+				User.updatePassword({password: $scope.user.password, newPassword: $scope.user.newPassword,secLevel:$scope.secLevel}, {}, function(){
 					toaster.pop('success', '成功', '修改密码成功,请牢记您的新密码。');
 					$scope.user.password = null;
 					$scope.user.newPassword = null;
@@ -600,6 +631,11 @@ define(['app/app'], function(app) {
         $scope.user.newUserEmail = null;
         //验证用户输入的旧邮箱地址是否正确
         $scope.checkUserEmail = function(userEmail) {
+        	if(userEmail==null){
+            $scope.checkFailed = true;
+            $scope.checkSuccess = false;
+            return;
+					}
             $scope.checkSuccess = false;
             $scope.checkFailed = false;
             User.checkUserEmail({userEmail: userEmail}, function(){
@@ -615,6 +651,11 @@ define(['app/app'], function(app) {
         $scope.checkSuccess1 = false;
         $scope.checkFailed1 = false;
         $scope.emailEnable = function(newUserEmail) {
+        	if((newUserEmail==null || newUserEmail.length>30) && !/^(\w)+(\.\w+)*@(\w)+((\.\w{2,3}){1,3})$/.test(newUserEmail)){
+            $scope.checkSuccess1 = false;
+            $scope.checkFailed1 = true;
+            $scope.sendSuccess = false;
+					}
             User.emailEnable({email: newUserEmail}, function(data){
 								if(data.data == "true"){//邮箱可用
                   $scope.checkSuccess1 = true;
@@ -727,16 +768,22 @@ define(['app/app'], function(app) {
         };
 
         //新手机号是否可用
-		$scope.checking1 = false;
         $scope.sendSuccess = false;
+      $scope.checkFailed1 = false;
+      $scope.checkSuccess1 = false;
         $scope.telEnable = function(newUserTel) {
+        	if(newUserTel==null || !/^[0-9]{8,11}$/.test(newUserTel)){
+            $scope.checkFailed1 = true;
+            $scope.checkSuccess1 = false;
+            $scope.sendSuccess = false;
+            return;
+					}
             $scope.checking1 = true;
             $scope.checkSuccess1 = false;
             $scope.checkFailed1 = false;
             User.telEnable({tel: newUserTel}, function(data){
                 if(data.data == "true"){//手机可用
                     $scope.checkSuccess1 = true;
-                    $scope.checking1 = false;
                     $scope.checkFailed1 = false;
                     $scope.sendSuccess = true;
                 }else{//手机不可用
@@ -780,6 +827,7 @@ define(['app/app'], function(app) {
         };
 
         $scope.validSuccess = false;
+      $scope.validFailed = false;
         //校验验证码
         $scope.validTelCheckCode = function(telCheckCode) {
             User.validTelCheckCode({telCheckCode: telCheckCode}, function(data){
@@ -787,20 +835,22 @@ define(['app/app'], function(app) {
                 var message = data.message;
                 if(status == 1){
                     $scope.validSuccess = true;
+                  $scope.validFailed = false;
                 }else{
                   $scope.validSuccess = false;
+                  $scope.validFailed = true;
                 }
             });
         };
 
-        //修改邮箱地址
+        //修改手机
         $scope.ok = function () {
             if($scope.user.newUserTel == $scope.user.userTel){
                 toaster.pop('error', '错误', '新手机号与旧手机号相同');
                 return;
             }
             User.updateUserTel({newUserTel:$scope.user.newUserTel,userTel:$scope.user.userTel}, {}, function(){
-                toaster.pop('success', '成功', '手机验证成功。');
+                toaster.pop('success', '成功', '手机修改成功。');
                 $scope.user.userTel = null;
                 $scope.user.newUserTel = null;
                 $scope.checking = false;
@@ -875,7 +925,7 @@ define(['app/app'], function(app) {
 					return;
 				}
 				//正则校验
-				var reg = /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{8,20}$/;
+				var reg = /^\d{6}$/;
 				if(!reg.test(newUserPay)){
 					$scope.checkFailed1 = true;
 					$scope.checkSuccess1 = false;
@@ -1048,18 +1098,19 @@ define(['app/app'], function(app) {
       $scope.checkFailed = false;
       $scope.checkUserName = function(userName){
 					if(userName==null){
-            toaster.pop('error', '请输入您的真实姓名');
+            //toaster.pop('error', '请输入您的真实姓名');
             $scope.checkSuccess = false;
             $scope.checkFailed = true;
             return ;
 					}else if(userName.length>20){
-            toaster.pop('error', '请勿超过20个字符');
+            //toaster.pop('error', '请勿超过20个字符');
             $scope.checkSuccess = false;
-            $scope.checkFailed = true;
+            $scope.checkFailed_1 = true;
             return ;
 					}else{
 						$scope.checkSuccess = true;
             $scope.checkFailed = false;
+            $scope.checkFailed_1 = false;
 					}
 			}
 
@@ -1068,18 +1119,19 @@ define(['app/app'], function(app) {
       $scope.checkFailed1 = false;
       $scope.checkUserIdcode = function(userIdcode){
         if(userIdcode==null){
-          toaster.pop('error', '请输入您的身份证号');
+          //toaster.pop('error', '请输入您的身份证号');
           $scope.checkSuccess1 = false;
           $scope.checkFailed1 = true;
           return ;
         }else if(userIdcode.length!=18){
           //toaster.pop('error', '请输入18位的身份证号');
           $scope.checkSuccess1 = false;
-          $scope.checkFailed1 = true;
+          $scope.checkFailed1_1 = true;
           return ;
         }else{
           $scope.checkSuccess1 = true;
           $scope.checkFailed1 = false;
+          $scope.checkFailed1_1 = false;
         }
       }
 
@@ -1104,6 +1156,7 @@ define(['app/app'], function(app) {
           $scope.checkFailed1 = false;
           $scope.checkSuccess = false;
           $scope.checkFailed = false;
+          location.reload();
         }, function(response){
           toaster.pop('error', '错误', response.data);
           $modalInstance.close();

+ 7 - 5
src/main/webapp/resources/view/usercenter/forstore/account_manager.html

@@ -188,7 +188,7 @@
 					<!--<i>中</i>-->
 					<!--完成<a href="javascript:void(0)"> 密保设置</a>,提升账户安全。-->
 				</span>
-				<div class="last-login">上次登录时间:<span>2017-10-10&nbsp;&nbsp;14:08:44</span></div>
+				<div class="last-login">上次登录时间:<span>{{userInfo.lastLoginTime | date:'yyyy-MM-dd hh:mm:ss'}} </span></div>
 			</li>
 			<li ng-switch="userInfo.idEnable">
 				<span>
@@ -218,13 +218,14 @@
 					<font>密保问题:</font>
 					<span>是您找回登录密码的方式之一。建议您设置一个容易记住,且最不容易被他人获取的问题及答案,更有效保障您的密...</span>
 				</span>
-				<a ng-click="updateUserQuestion()" class="mall-btn-default">立即设置</a>
+				<a ng-hide="userInfo.haveUserQuestion" ng-click="updateUserQuestion()" class="mall-btn-default">立即设置</a>
+				<a ng-show="userInfo.haveUserQuestion" ng-click="updateUserQuestion()">修改</a>
 			</li>
 			<li>
 				<span>
 					<h5><img class="ok-icon" src="static/img/user/images/ok-account.png"/></h5>
 					<font>手机验证:</font>
-					<span>绑定手机后,您即可享受淘宝丰富的手机服务,如手机找回密码等。</span>
+					<span>您绑定的手机:{{userInfo.userTel}}。若已丢失或停用,请立即更换,避免账户被盗。</span>
 				</span>
 				<a ng-click="updateUserTel()">修改</a>
 			</li>
@@ -233,7 +234,8 @@
 					<h5 ng-show="userInfo.userEmail==null?false:true"><img class="ok-icon" src="static/img/user/images/ok-account.png"/></h5>
 					<h5 ng-hide="userInfo.userEmail==null?false:true"><img src="static/img/user/images/safe.png"/></h5>
 					<font>邮箱认证:</font>
-					<span>您当前的邮箱:529010777@qq.com</span>
+					<span ng-show="userInfo.userEmail==null?false:true">{{userInfo.userEmail}}</span>
+					<span ng-hide="userInfo.userEmail==null?false:true">绑定邮箱可帮助您找回登录密码,并可订阅获取最新的订单动态、促销信息。</span>
 				</span>
 				<a ng-show="userInfo.userEmail==null?false:true" ng-click="updateUserEmail()">修改</a>
 				<a ng-hide="userInfo.userEmail==null?false:true" ng-click="updateUserEmail()">立即设置</a>
@@ -246,7 +248,7 @@
 					<span>在使用账户中余额或确认收货时,需输入支付密码。</span>
 				</span>
 				<a ng-hide="userInfo.havePayPwd" ng-click="updateUserPay()" class="mall-btn-default">立即设置</a>
-				<a ng-show="userInfo.havePayPwd" ng-click="updateUserPay()" class="mall-btn-default">修改</a>
+				<a ng-show="userInfo.havePayPwd" ng-click="updateUserPay()">修改</a>
 			</li>
 		</ul>
 	</div>

+ 2 - 2
src/main/webapp/resources/view/usercenter/modal/homeCenter_modal.html

@@ -39,12 +39,12 @@
         <p>安全设置</p>
     </div>
     <div class="modal-body">
-        你的账户的安全等级过低,请<a ng-hide="userInfo.pwdEnable" ng-click="goLink('pwd')">修改密码</a>
+        你的账户的安全等级过低,请 <a ng-hide="userInfo.pwdEnable" ng-click="goLink('pwd')">修改密码</a>
         <span ng-hide="userInfo.haveUserQuestion && userInfo.userEmail==null?false:true" >
             ,<a ng-click="goLink('question')">设置密保问题</a>
             <a ng-click="goLink('email')">绑定邮箱</a>
         </span>来保障您的账户安全!
-        <a class="mall-btn-default">立即前往</a>
+        <a class="mall-btn-default" ng-click="goLink('sec')" >立即前往</a>
     </div>
 </div>

+ 8 - 6
src/main/webapp/resources/view/vendor/modal/updatePassword.html

@@ -97,7 +97,7 @@
 			<div class="col-md-8 col-sm-8 col">{{::user.userTel}} - {{::user.userName}} </div>
 		</div>
 		-->
-		<div class="row line">
+		<div class="row line" ng-class="{'has-success': checkSuccess, 'has-error': checkFailed}">
 			<label class="col-md-3 col-sm-3 col text-right">原密码:</label>
 			<div class="col-md-8 col-sm-8 col">
 				<input ng-model="user.password" class="form-control input-sm" type="password" ng-blur="checkPassword(user.password)" required placeholder="当前密码">
@@ -106,13 +106,13 @@
 			<div class="col">
 				<img ng-show="checkSuccess" src="static/img/user/images/input-check-yes.png" alt="">
 				<!--<i ng-show="checkSuccess" class="fa fa-check" style="color:#339933"></i>-->
-				<!--<i ng-show="checkFailed" class="fa fa-close" style="color:#CC3333;"></i>-->
+				<i ng-show="checkFailed" class="fa fa-close" style="color:#CC3333;"></i>
 			</div>
 		</div>
 		<div class="row new-password" ng-class="{'has-success': checkSuccess1, 'has-error': checkFailed1}">
 			<label class="col-md-3 col-sm-3 col text-right">新密码:</label>
 			<div class="col-md-8 col-sm-8 col">
-				<input ng-model="user.newPassword" ng-blur="checkNewPassword(user.newPassword)" class="form-control input-sm" type="password" required  placeholder="8~20位字母、数字、符号">
+				<input ng-model="user.newPassword" ng-keyup="checkPasswordLevel(user.newPassword)" ng-blur="checkNewPassword(user.newPassword)" class="form-control input-sm" type="password" required  placeholder="8~20位字母、数字、符号">
 				<!-- <div>密码复杂度</div> -->
 				<img src="static/img/user/images/keyboard.png" alt="">
 			</div>
@@ -121,14 +121,16 @@
 				<!--<i ng-show="checkSuccess1" class="fa fa-check" style="color:#339933"></i>-->
 				<!--<i ng-show="checkFailed1" class="fa fa-close" style="color:#CC3333;"></i>-->
 			</div>
-			<div class="safe-level">安全等级:
+			<div class="safe-level" ng-hide="checkFailed1">安全等级:
 				<span>
-					<span>弱</span><span>中</span><span>强</span>
+					<span ng-show="secLevel>=1">弱</span>
+					<span ng-show="secLevel>=2">中</span>
+					<span ng-show="secLevel>=3">强</span>
 				</span>
 			</div>
 		</div>
 		<div class="warn-style" ng-show="checkFailed1">密码为8-20字符的英文、数字混合密码</div>
-		<div class="row line">
+		<div class="row line" ng-class="{'has-success': checkSuccess2, 'has-error': checkFailed2}">
 			<label ng-model="user.newPassword1" class="col-md-3 col-sm-3 col text-right">重复新密码:</label>
 			<div class="col-md-8 col-sm-8 col">
 				<input ng-model="user.newPassword1" ng-blur="checkNewPassword1(user.newPassword1)" class="form-control input-sm" type="password" required placeholder="重复新密码">

+ 4 - 1
src/main/webapp/resources/view/vendor/modal/updateRealAuth.html

@@ -85,6 +85,8 @@
                 <!--<i ng-show="checkSuccess" class="fa fa-check" style="color:#339933"></i>-->
                 <!--<i ng-show="checkFailed" class="fa fa-close" style="color:#CC3333;"></i>-->
             </div>
+            <div class="warn-style" ng-show="checkFailed">请输入您的真实姓名</div>
+            <div class="warn-style" ng-show="checkFailed_1">请勿超过20个字符</div>
         </div>
         <div class="row">
             <label class="col-md-3 col-sm-3 col text-right">身份证号:</label>
@@ -99,7 +101,8 @@
                 <!--<i ng-show="checkFailed1" class="fa fa-close" style="color:#CC3333;"></i>-->
             </div>
         </div>
-        <div class="warn-style" ng-show="checkFailed1">请输入18位的身份证号</div>
+        <div class="warn-style" ng-show="checkFailed1">请输入您的身份证号</div>
+        <div class="warn-style" ng-show="checkFailed1_1">请输入18位的身份证号</div>
         <div class="upload-area">
             <div class="area-header">请上传一张本人手持身份证照片:</div>
             <input type="hidden" name="idImgUrl" ng-model="user.idImgUrl"/>

+ 7 - 12
src/main/webapp/resources/view/vendor/modal/updateUserEmail.html

@@ -82,13 +82,7 @@
 <form class="userEmail" name="sampleSendForm" ng-submit="ok()">
     <input type="hidden" ng-model="pageToken"/>
     <div class="modal-body">
-        <!--
-        <div class="row">
-            <label class="col-md-3 col-sm-3 col text-right">用户:</label>
-            <div class="col-md-8 col-sm-8 col">{{::user.userTel}} - {{::user.userName}}</div>
-        </div>
-        -->
-        <div class="row line" ng-class="{'has-success': checkSuccess, 'has-error': checkFailed}">
+        <div class="row line" ng-hide="userInfo.userEmail==null?true:false" ng-class="{'has-success': checkSuccess, 'has-error': checkFailed}">
             <label class="col-md-3 col-sm-3 col text-right">原邮箱地址:</label>
             <div class="col-md-8 col-sm-8 col"><input ng-model="user.userEmail" class="form-control input-sm"
                                                       type="userEmail" ng-blur="checkUserEmail(user.userEmail)" required
@@ -96,14 +90,15 @@
             <div class="col">
                 <img ng-show="checkSuccess" src="static/img/user/images/input-check-yes.png" alt="">
                 <!--<i ng-show="checkSuccess" class="fa fa-check" style="color:#339933"></i>-->
-                <!--<i ng-show="checkFailed" class="fa fa-close" style="color:#CC3333;"></i>-->
+                <i ng-show="checkFailed" class="fa fa-close" style="color:#CC3333;"></i>
             </div>
         </div>
         <div class="row">
-            <label class="col-md-3 col-sm-3 col text-right">新邮箱地址:</label>
+            <label class="col-md-3 col-sm-3 col text-right" ng-hide="userInfo.userEmail==null?true:false">新邮箱地址:</label>
+            <label class="col-md-3 col-sm-3 col text-right" ng-show="userInfo.userEmail==null?true:false">邮箱地址:</label>
             <div class="col-md-8 col-sm-8 col">
                 <input ng-model="user.newUserEmail"
-                       class="form-control input-sm" ng-pattern="/^[a-z0-9]+([._\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/" type="newUserEmail" required ng-blur="emailEnable(user.newUserEmail)" placeholder="新邮箱地址">
+                       class="form-control input-sm" type="newUserEmail" required ng-blur="emailEnable(user.newUserEmail)" placeholder="新邮箱地址">
                 <!-- <div>密码复杂度</div> -->
             </div>
             <div class="col">
@@ -112,7 +107,7 @@
                 <!--<i ng-show="checkFailed1" class="fa fa-close" style="color:#cc3333;"></i>-->
             </div>
         </div>
-        <div class="warn-style">请输入正确的邮箱</div>
+        <div class="warn-style"  ng-show="checkFailed1">请输入正确的邮箱</div>
         <div class="row validate-code">
             <label class="col-md-3 col-sm-3 col text-right">验证码:</label>
             <div class="col-md-8 col-sm-8 col">
@@ -121,7 +116,7 @@
                 <input ng-click="sendCheckCode(user.newUserEmail)" ng-disabled="!sendSuccess" ng-init="paracont='获取验证码'" class="code-btn" ng-model="paracont"/>
             </div>
         </div>
-        <div class="warn-style">验证码错误</div>
+        <div class="warn-style" ng-show="codeFailed">验证码错误</div>
     </div>
     <div class="modal-footer">
         <button ng-click="cancel()" type="button">取消</button>

+ 5 - 5
src/main/webapp/resources/view/vendor/modal/updateUserPay.html

@@ -78,13 +78,13 @@
                 <!--<i ng-show="checkFailed" class="fa fa-close" style="color:#CC3333;"></i>-->
             </div>
         </div>
-        <div class="warn-style">密码为6位数字</div>
+        <div class="warn-style oldUserPay" ng-show="checkFailed">密码为6位数字</div>
         <div class="row">
             <label class="col-md-3 col-sm-3 col text-right" ng-hide="!isNewFailed">新密码:</label>
             <label class="col-md-3 col-sm-3 col text-right" ng-hide="!isNewSuccess">密码:</label>
             <div class="col-md-8 col-sm-8 col">
                 <input ng-model="user.newUserPay"
-                       class="form-control input-sm" type="password" name="newUserPay" ng-keyup="checkNewUserPay(user.newUserPay)" required>
+                       class="form-control input-sm" type="password" name="newUserPay" ng-blur="checkNewUserPay(user.newUserPay)" required>
                 <img src="static/img/user/images/keyboard.png" alt="">
                 <!-- <div>密码复杂度</div> -->
             </div>
@@ -94,12 +94,12 @@
                 <!--<i ng-show="checkFailed1" class="fa fa-close" style="color:#CC3333;"></i>-->
             </div>
         </div>
-        <div class="warn-style">密码为6位数字</div>
+        <div class="warn-style" ng-show="checkFailed1">密码为6位数字</div>
         <div class="row">
             <label class="col-md-3 col-sm-3 col text-right">确认密码:</label>
             <div class="col-md-8 col-sm-8 col">
                 <input ng-model="user.newUserPay1"
-                       class="form-control input-sm" name="newUserPay1"  type="password" ng-keyup="checkNewUserPay1()" required>
+                       class="form-control input-sm" name="newUserPay1"  type="password" ng-blur="checkNewUserPay1()" required>
                 <img src="static/img/user/images/keyboard.png" alt="">
             </div>
             <div class="col">
@@ -108,7 +108,7 @@
                 <!--<i ng-show="checkFailed2" class="fa fa-close" style="color:#CC3333;"></i>-->
             </div>
         </div>
-        <div class="warn-style">两次输入的密码不一致</div>
+        <div class="warn-style" ng-show="checkFailed2">两次输入的密码不一致</div>
     </div>
     <div class="modal-footer">
         <button ng-click="cancel()" type="button">取消</button>

+ 9 - 4
src/main/webapp/resources/view/vendor/modal/updateUserTel.html

@@ -90,10 +90,10 @@
             <div class="col">
                 <img ng-show="checkSuccess" src="static/img/user/images/input-check-yes.png" alt="">
                 <!--<i ng-show="checkSuccess" class="fa fa-check" style="color:#339933"></i>-->
-                <!--<i ng-show="checkFailed" class="fa fa-close" style="color:#CC3333;"></i>-->
+                <i ng-show="checkFailed" class="fa fa-close" style="color:#CC3333;"></i>
             </div>
         </div>
-        <div class="row">
+        <div class="row" ng-class="{'has-success': checkSuccess1, 'has-error': checkFailed1}">
             <label class="col-md-3 col-sm-3 col text-right">新手机号:</label>
             <div class="col-md-8 col-sm-8 col">
                 <input ng-model="user.newUserTel"
@@ -106,7 +106,7 @@
                 <!--<i ng-show="checkFailed1" class="fa fa-close" style="color:#CC3333;"></i>-->
             </div>
         </div>
-        <div class="warn-style" ng-show="checkFailed1">手机号为8-11位数字</div>
+        <div class="warn-style" ng-show="checkFailed1">请输入正确的手机号</div>
         <div class="row validate-code">
             <label class="col-md-3 col-sm-3 col text-right">验证码:</label>
             <span class="col-md-8 col-sm-8 col">
@@ -116,7 +116,12 @@
             </span>
         </div>
     </div>
-    <div class="warn-style" ng-show="validSuccess">验证码错误</div>
+    <div class="col">
+        <img ng-show="vaildSuccess" src="static/img/user/images/input-check-yes.png" alt="">
+        <!--<i ng-show="checkSuccess1" class="fa fa-check" style="color:#339933"></i>-->
+        <!--<i ng-show="checkFailed1" class="fa fa-close" style="color:#CC3333;"></i>-->
+    </div>
+    <div class="warn-style" ng-show="validFailed">验证码错误</div>
     <div class="modal-footer">
         <button ng-click="cancel()" type="button">取消</button>
         <button ng-disabled="!validSuccess || !checkSuccess || !checkSuccess1" type="submit">确定</button>