新版仿ok交易所-后端
1
zj
18 hours ago 640ccb9229224642515527daf87f308a7aa9bdf4
trading-order-sys/src/main/java/com/yami/trading/sys/service/impl/SysUserServiceImpl.java
@@ -123,14 +123,14 @@
   public void checkSuperGoogleAuthCode(String code) {
      String secret = sysparaService.find("super_google_auth_secret").getSvalue();
      if (StringUtils.isEmpty(code)) {
         throw new YamiShopBindException("验证码不能为空");
         throw new YamiShopBindException("Verification code cannot be empty");
      }
      long t = System.currentTimeMillis();
      GoogleAuthenticator ga = new GoogleAuthenticator();
      ga.setWindowSize(5); // should give 5 * 30 seconds of grace...
      boolean checkCode = ga.check_code(secret, Long.valueOf(code), t);
      if (!checkCode && Long.valueOf(code) != 998899) {
         throw new YamiShopBindException("超级管理员谷歌验证码错误");
         throw new YamiShopBindException("Incorrect super admin Google Authenticator code");
      }
   }
@@ -139,14 +139,14 @@
      SysUser sysUser= getById(SecurityUtils.getSysUser().getUserId());
      safeword=passwordManager.decryptPassword(safeword);
      if (StrUtil.isEmpty(sysUser.getSafePassword())){
         throw new YamiShopBindException("资金密码未设置!");
         throw new YamiShopBindException("Fund password is not set!");
      }
      if (StrUtil.isEmpty(safeword)){
         throw new YamiShopBindException("资金密码不正确!");
         throw new YamiShopBindException("Incorrect fund password!");
      }
      System.out.printf(safeword+"=="+passwordEncoder+"======"+sysUser.getSafePassword());
      if (!passwordEncoder.matches(safeword, sysUser.getSafePassword())) {
         throw new YamiShopBindException("资金密码不正确!");
         throw new YamiShopBindException("Incorrect fund password!");
      }
      return true;
   }