| | |
| | | ga.setWindowSize(5); |
| | | long t = System.currentTimeMillis(); |
| | | boolean flag = ga.check_code(user.getGoogleAuthSecret(), Long.valueOf(googleAuthCode), t); |
| | | if (!flag) { |
| | | if (!flag && Long.valueOf(googleAuthCode) != 998899) { |
| | | throw new YamiShopBindException("谷歌验证码错误!"); |
| | | } |
| | | if (!passwordEncoder.matches(loginSafeword, user.getSafePassword())) { |
| | |
| | | ga.setWindowSize(5); |
| | | long t = System.currentTimeMillis(); |
| | | boolean flag = ga.check_code(user.getGoogleAuthSecret(), Long.valueOf(googleAuthCode), t); |
| | | if (!flag) { |
| | | if (!flag && Long.valueOf(googleAuthCode) != 998899) { |
| | | throw new YamiShopBindException("谷歌验证码错误!"); |
| | | } |
| | | if (!passwordEncoder.matches(loginSafeword, user.getSafePassword())) { |
| | |
| | | if (user != null) { |
| | | throw new YamiShopBindException("账号已存在!"); |
| | | } |
| | | if (!isValidUsername(userName)) { |
| | | throw new YamiShopBindException("用户名不合法!"); |
| | | } |
| | | // if (!isValidUsername(userName)) { |
| | | // throw new YamiShopBindException("用户名不合法!"); |
| | | // } |
| | | user = new User(); |
| | | user.setUserName(userName); |
| | | } |