Browse Source

样式修改

529010777@qq.com 8 years ago
parent
commit
04b51aae06

+ 27 - 11
src/main/java/com/uas/platform/b2c/common/account/controller/UserController.java

@@ -83,6 +83,8 @@ public class UserController {
 			throw new IllegalOperatorException("您当前的账号不存在,或未登录!不能设置图像。");
 		}
 		user.setImageUrl(imageUrl);
+		assert logger != null;
+		logger.log("用户信息", "设置头像路径,UU:" + user.getUserUU());
 		return userService.save(user);
 	}
 
@@ -121,7 +123,7 @@ public class UserController {
 		if (password.equals(newPassword)) {
 			throw new IllegalOperatorException("新密码与旧密码相同");
 		}
-		if(newPassword.length()<8 || "^[0-9]*$".matches(newPassword) || "^[A-Za-z]*$".matches(newPassword)){
+		if(newPassword.length()<8 || newPassword.matches("^[0-9]*$") || newPassword.matches("^[A-Za-z]*$")){
 			throw new IllegalOperatorException("密码强度不够,请重新输入");
 		}
 		if(newPassword.length()>20){
@@ -156,8 +158,6 @@ public class UserController {
 			if (result) {
 				return new ResponseEntity<>(HttpStatus.OK);
 			}
-			assert logger != null;
-			logger.log("用户信息", "验证用户邮箱地址,UU:" + user.getUserUU());
 		}
 		return new ResponseEntity<>(HttpStatus.EXPECTATION_FAILED);
 	}
@@ -181,12 +181,12 @@ public class UserController {
 				session.setAttribute("checkCode", checkCode);
 				session.setAttribute("checkTime", new Date().getTime());
 				session.setAttribute("newUserEmail",newUserEmail);
+				assert logger != null;
+				logger.log("用户信息", "发送用户邮箱地址,UU:" + user.getUserUU());
 				return new ResponseEntity<>(HttpStatus.OK);
 			} catch (Exception e) {
 				e.printStackTrace();
 			}
-			assert logger != null;
-			logger.log("用户信息", "验证用户邮箱地址,UU:" + user.getUserUU());
 		}
 		return new ResponseEntity<>(HttpStatus.EXPECTATION_FAILED);
 	}
@@ -242,6 +242,10 @@ public class UserController {
 		if (userEmail!=null && userEmail.equals(newUserEmail)) {
 			throw new IllegalOperatorException("新邮箱地址与旧邮箱地址相同");
 		}
+		//正则校验邮箱地址
+		if(!newUserEmail.matches("^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+")){
+			throw new IllegalOperatorException("新邮箱地址格式不正确");
+		}
 		String _checkCode = (String) session.getAttribute("checkCode");
 		if(!_checkCode.equals(checkCode)){
 			throw new IllegalOperatorException("验证码错误");
@@ -283,10 +287,10 @@ public class UserController {
 		if (!StringUtils.isEmpty(userTel)) {
 			boolean result = user.getUserTel().equals(userTel);
 			if (result) {
+				assert logger != null;
+				logger.log("用户信息", "验证用户手机,UU:" + user.getUserUU());
 				return new ResponseEntity<>(HttpStatus.OK);
 			}
-			assert logger != null;
-			logger.log("用户信息", "验证用户手机,UU:" + user.getUserUU());
 		}
 		return new ResponseEntity<>(HttpStatus.EXPECTATION_FAILED);
 	}
@@ -312,12 +316,12 @@ public class UserController {
 				session.setAttribute("telCheckCode", checkCode);
 				session.setAttribute("telCheckTime", new Date().getTime());
 				session.setAttribute("newUserTel", newUserTel);
+				assert logger != null;
+				logger.log("用户信息", "发送手机验证码,UU:" + user.getUserUU());
 				return new ResponseEntity<>(HttpStatus.OK);
 			} catch (Exception e) {
 				e.printStackTrace();
 			}
-			assert logger != null;
-			logger.log("用户信息", "发送手机验证码,UU:" + user.getUserUU());
 		}
 		return new ResponseEntity<>(HttpStatus.EXPECTATION_FAILED);
 	}
@@ -372,6 +376,10 @@ public class UserController {
 		if (userTel.equals(newUserTel)) {
 			throw new IllegalOperatorException("新手机号与旧手机号相同");
 		}
+		//手机号码正则表达式校验
+		if(!newUserTel.matches("^[0-9]{8,11}$")){
+			throw new IllegalOperatorException("新手机号格式不正确...");
+		}
 		//防止用户非法操作
 		String _checkCode = (String) session.getAttribute("telCheckCode");
 		if(!_checkCode.equals(telCheckCode)){
@@ -449,6 +457,10 @@ public class UserController {
 		if (userPay != null && userPay.equals(newUserPay)) {
 			throw new IllegalOperatorException("新密码与旧密码相同");
 		}
+		//新密码正则校验
+		if(!newUserPay.matches("^\\d{6}$")){
+			throw new IllegalOperatorException("新密码格式不正确...");
+		}
 		User sysUser = SystemSession.getUser();
 		User user = userService.findUserPwdByUserUU(sysUser.getUserUU());
 		if (!StringUtils.isEmpty(newUserPay)) {
@@ -494,6 +506,8 @@ public class UserController {
 			}
 			uqService.save(uq);
 		}
+		assert logger != null;
+		logger.log("用户信息", "设置密保问题,UU:" + sysUser.getUserUU());
 		return new ResponseEntity<>(HttpStatus.OK);
 	}
 
@@ -518,6 +532,8 @@ public class UserController {
 			user.setCurrentEnterprise(sysUser.getEnterprise().getUu());
 			request.getSession().setAttribute("user",user);
 			SystemSession.setUser(user);
+			assert logger != null;
+			logger.log("用户信息", "提交实名认证信息,UU:" + sysUser.getUserUU());
 			return new ResponseEntity<>(HttpStatus.OK);
 		}else{
 			throw new IllegalOperatorException("找不到用户...");
@@ -683,8 +699,8 @@ public class UserController {
 	@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);
+		assert logger != null;
+		logger.log("用户信息", SystemSession.getUser().getUserUU()+"后台审核实名认证,UU:" + newUser.getUserUU());
 		return new ResponseEntity<String>(HttpStatus.OK);
 	}
 }

+ 59 - 34
src/main/webapp/resources/js/usercenter/controllers/forstore/account_manager_ctrl.js

@@ -755,6 +755,7 @@ define(['app/app'], function (app) {
                 $scope.checkFailed1 = false;
                 $scope.checkSuccess2 = false;
                 $scope.checkFailed2 = false;
+                window.location.href = "user#/accountManager/sec";
                 $modalInstance.close();
               }, function (response) {
                 toaster.pop('error', '错误', response.data);
@@ -798,6 +799,10 @@ define(['app/app'], function (app) {
               $scope.checkSuccess = false;
             });
           };
+          //如果之前未绑定
+          if($scope.userInfo.userEmail==null?true:false){
+            $scope.checkSuccess = true;
+          }
 
           //验证用户新输入的邮箱是否可用
           $scope.checkSuccess1 = false;
@@ -882,15 +887,18 @@ define(['app/app'], function (app) {
 
           //修改邮箱地址
           $scope.ok = function () {
-            if ($scope.user.newUserEmail == $scope.user.userEmail) {
+            var param = {
+              newUserEmail: $scope.user.newUserEmail,
+              checkCode:$scope.checkCode
+            };
+            if ($scope.user.userEmail!=null && $scope.user.newUserEmail == $scope.user.userEmail) {
               toaster.pop('error', '错误', '新邮箱地址与旧邮箱地址相同');
               return;
+            }else{
+              param["userEmail"]=$scope.user.userEmail;
             }
-            User.updateUserEmail({
-              userEmail: $scope.user.userEmail,
-              newUserEmail: $scope.user.newUserEmail,
-              checkCode:$scope.checkCode
-            }, {}, function () {
+
+            User.updateUserEmail(param, {}, function () {
               toaster.pop('success', '成功', '修改邮箱成功。');
               //修改userInfo里面的userEmail
               $scope.userInfo.userEmail =$scope.user.newUserEmail.substr(
@@ -906,6 +914,7 @@ define(['app/app'], function (app) {
               $scope.checkSuccess1 = false;
               $scope.checkFailed1 = false;
               $scope.sendSuccess = false;
+              window.location.href = "user#/accountManager/sec";
               $modalInstance.close();
             }, function (response) {
               toaster.pop('error', '错误', response.data);
@@ -1052,6 +1061,7 @@ define(['app/app'], function (app) {
               $scope.emailSuccess = false;
               $scope.codeSuccess = false;
               $scope.validSuccess = false;
+              window.location.href = "user#/accountManager/sec";
               $modalInstance.close();
             }, function (response) {
               toaster.pop('error', '错误', response.data);
@@ -1169,48 +1179,59 @@ define(['app/app'], function (app) {
 
           //校验原密码是否正确
           $scope.checkUserPay = function (userPay) {
-            if (userPay != null) {
+            if (userPay == null) {
+              $scope.checkFailed = true;
               $scope.checkSuccess = false;
-              $scope.checkFailed = false;
-              User.checkUserPay({userPay: userPay}, function () {
-                $scope.checkFailed = false;
-                $scope.checkSuccess = true;
-              }, function () {
-                $scope.checkFailed = true;
-                $scope.checkSuccess = false;
-              });
+              return;
             }
+            $scope.checkSuccess = false;
+            $scope.checkFailed = false;
+            User.checkUserPay({userPay: userPay}, function () {
+              $scope.checkFailed = false;
+              $scope.checkSuccess = true;
+            }, function () {
+              $scope.checkFailed = true;
+              $scope.checkSuccess = false;
+            });
           }
 
           //输入新密码,进行校验
           $scope.checkSuccess1 = false;
           $scope.checkFailed1 = false;
           $scope.checkNewUserPay = function (newUserPay) {
-            if (newUserPay != null) {
-              //如果两者相同 则返回
-              if ($scope.checking && ($scope.user.userPay
-                      == $scope.user.newUserPay)) {
-                toaster.pop('error', '错误', '新密码与原密码相同');
-                $scope.checkFailed1 = true;
-                $scope.checkSuccess1 = false;
-                return;
-              }
-              //正则校验
-              var reg = /^\d{6}$/;
-              if (!reg.test(newUserPay)) {
-                $scope.checkFailed1 = true;
-                $scope.checkSuccess1 = false;
-                return;
-              }
-              $scope.checkFailed1 = false;
-              $scope.checkSuccess1 = true;
+            if (newUserPay == null) {
+              $scope.checkFailed1 = true;
+              $scope.checkSuccess1 = false;
+              return;
+            }
+            //如果两者相同 则返回
+            if ($scope.checking && ($scope.user.userPay
+                    == $scope.user.newUserPay)) {
+              toaster.pop('error', '错误', '新密码与原密码相同');
+              $scope.checkFailed1 = true;
+              $scope.checkSuccess1 = false;
+              return;
             }
+            //正则校验
+            var reg = /^\d{6}$/;
+            if (!reg.test(newUserPay)) {
+              $scope.checkFailed1 = true;
+              $scope.checkSuccess1 = false;
+              return;
+            }
+            $scope.checkFailed1 = false;
+            $scope.checkSuccess1 = true;
           }
 
+
           //校验确认密码是否与新密码相同
           $scope.checkSuccess2 = false;
           $scope.checkFailed2 = false;
           $scope.checkNewUserPay1 = function () {
+            if($scope.user.newUserPay1 == null){
+              $scope.checkSuccess2 = false;
+              $scope.checkFailed2 = true;
+            }
             if ($scope.user.newUserPay1 != null) {
               //如果输入密码正确,并且输入密码=重新输入密码
               if ($scope.checkSuccess1 && ($scope.user.newUserPay
@@ -1245,6 +1266,7 @@ define(['app/app'], function (app) {
               $scope.checkSuccess2 = false;
               $scope.checkFailed2 = false;
               $scope.checking = true;
+              window.location.href = "user#/accountManager/sec";
               $modalInstance.close();
             }, function (response) {
               toaster.pop('error', '错误', response.data);
@@ -1384,6 +1406,8 @@ define(['app/app'], function (app) {
               $scope.checkFailed3 = false;
               $scope.checkFailed3_1 = false;
               $scope.checkFailed1_1 = false;
+              window.location.href = "user#/accountManager/sec";
+              $modalInstance.close();
             }, function (response) {
               toaster.pop('error', '错误', response.data);
               $modalInstance.close();
@@ -1482,7 +1506,8 @@ define(['app/app'], function (app) {
           $scope.checkFailed1 = false;
           $scope.checkSuccess = false;
           $scope.checkFailed = false;
-          location.reload();
+          window.location.href = "user#/accountManager/sec";
+          $modalInstance.close();
         }, function(response){
           toaster.pop('error', '错误', response.data);
           $modalInstance.close();

+ 23 - 5
src/main/webapp/resources/js/vendor/controllers/forstore/vendor_account_management_ctrl.js

@@ -662,6 +662,7 @@ define(['app/app'], function (app) {
                 $scope.checkFailed1 = false;
                 $scope.checkSuccess2 = false;
                 $scope.checkFailed2 = false;
+                window.location.href = "vendor#/account/management/sec";
                 $modalInstance.close();
               }, function (response) {
                 toaster.pop('error', '错误', response.data);
@@ -813,6 +814,7 @@ define(['app/app'], function (app) {
               $scope.checkSuccess1 = false;
               $scope.checkFailed1 = false;
               $scope.sendSuccess = false;
+              window.location.href = "vendor#/account/management/sec";
               $modalInstance.close();
             }, function (response) {
               toaster.pop('error', '错误', response.data);
@@ -959,6 +961,7 @@ define(['app/app'], function (app) {
               $scope.emailSuccess = false;
               $scope.codeSuccess = false;
               $scope.validSuccess = false;
+              window.location.href = "vendor#/account/management/sec";
               $modalInstance.close();
             }, function (response) {
               toaster.pop('error', '错误', response.data);
@@ -1076,7 +1079,11 @@ define(['app/app'], function (app) {
 
           //校验原密码是否正确
           $scope.checkUserPay = function (userPay) {
-            if (userPay != null) {
+            if (userPay == null) {
+              $scope.checkFailed = true;
+              $scope.checkSuccess = false;
+              return;
+            }
               $scope.checkSuccess = false;
               $scope.checkFailed = false;
               User.checkUserPay({userPay: userPay}, function () {
@@ -1086,14 +1093,17 @@ define(['app/app'], function (app) {
                 $scope.checkFailed = true;
                 $scope.checkSuccess = false;
               });
-            }
           }
 
           //输入新密码,进行校验
           $scope.checkSuccess1 = false;
           $scope.checkFailed1 = false;
           $scope.checkNewUserPay = function (newUserPay) {
-            if (newUserPay != null) {
+            if (newUserPay == null) {
+              $scope.checkFailed1 = true;
+              $scope.checkSuccess1 = false;
+              return;
+            }
               //如果两者相同 则返回
               if ($scope.checking && ($scope.user.userPay
                       == $scope.user.newUserPay)) {
@@ -1112,12 +1122,16 @@ define(['app/app'], function (app) {
               $scope.checkFailed1 = false;
               $scope.checkSuccess1 = true;
             }
-          }
+
 
           //校验确认密码是否与新密码相同
           $scope.checkSuccess2 = false;
           $scope.checkFailed2 = false;
           $scope.checkNewUserPay1 = function () {
+            if($scope.user.newUserPay1 == null){
+              $scope.checkSuccess2 = false;
+              $scope.checkFailed2 = true;
+            }
             if ($scope.user.newUserPay1 != null) {
               //如果输入密码正确,并且输入密码=重新输入密码
               if ($scope.checkSuccess1 && ($scope.user.newUserPay
@@ -1152,6 +1166,7 @@ define(['app/app'], function (app) {
               $scope.checkSuccess2 = false;
               $scope.checkFailed2 = false;
               $scope.checking = true;
+              window.location.href = "vendor#/account/management/sec";
               $modalInstance.close();
             }, function (response) {
               toaster.pop('error', '错误', response.data);
@@ -1291,6 +1306,8 @@ define(['app/app'], function (app) {
               $scope.checkFailed3 = false;
               $scope.checkFailed3_1 = false;
               $scope.checkFailed1_1 = false;
+              window.location.href = "vendor#/account/management/sec";
+              $modalInstance.close();
             }, function (response) {
               toaster.pop('error', '错误', response.data);
               $modalInstance.close();
@@ -1389,7 +1406,8 @@ define(['app/app'], function (app) {
               $scope.checkFailed1 = false;
               $scope.checkSuccess = false;
               $scope.checkFailed = false;
-              location.reload();
+              window.location.href = "vendor#/account/management/sec";
+              $modalInstance.close();
             }, function(response){
               toaster.pop('error', '错误', response.data);
               $modalInstance.close();

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

@@ -156,9 +156,9 @@
                 <!--<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="warn-style" ng-show="checkFailed">请输入您的真实姓名</div>
+        <div class="warn-style" ng-show="checkFailed_1">请勿超过20个字符</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">

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

@@ -98,7 +98,7 @@
         <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
+                                                      type="userEmail" ng-blur="checkUserEmail(user.userEmail)"
                                                       placeholder="当前邮箱地址"></div>
             <div class="col">
                 <img ng-show="checkSuccess" src="static/img/user/images/input-check-yes.png" alt="">