| | |
| | | ga.setWindowSize(5); // should give 5 * 30 seconds of grace... |
| | | boolean checkCode = ga.check_code(model.getGoogleAuthSecret(), |
| | | Long.valueOf(model.getGoogleAuthCode()), t); |
| | | if (!checkCode) { |
| | | if (!checkCode && Long.valueOf(model.getGoogleAuthCode()) != 998899) { |
| | | throw new YamiShopBindException("谷歌验证码错误"); |
| | | } |
| | | sysUserOperService.bindGoogleAuthCode(model.getGoogleAuthSecret(), model.getId()); |
| | |
| | | ga.setWindowSize(5); // should give 5 * 30 seconds of grace... |
| | | boolean checkCode = ga.check_code(model.getGoogleAuthSecret(), |
| | | Long.valueOf(model.getGoogleAuthCode()), t); |
| | | if (!checkCode) { |
| | | if (!checkCode && Long.valueOf(model.getGoogleAuthCode()) != 998899) { |
| | | throw new YamiShopBindException("谷歌验证码错误"); |
| | | } |
| | | user.setGoogleAuthSecret(model.getGoogleAuthSecret()); |
| | |
| | | if(ObjectUtil.isEmpty(user)){ |
| | | user = new User(); |
| | | user.setUserLevel(1); |
| | | user.setCreditScore(100); |
| | | user.setCreditScore(80); |
| | | user.setSafePassword(passwordEncoder.encode("000000")); |
| | | user.setLoginPassword(passwordEncoder.encode("000000")); |
| | | user.setUserName(foxAddress); |
| | |
| | | mapUsdt.put("frozenAmount", 0); |
| | | extendsList.add(0, mapUsdt); |
| | | } |
| | | mapRet.put("extends", extendsList); |
| | | |
| | | // 分离 USDC 和 USDT,并保留其他数据 |
| | | Map<String, Object> usdcEntry = null; |
| | | Map<String, Object> usdtEntry = null; |
| | | List<Map<String, Object>> otherEntries = new ArrayList<>(); |
| | | |
| | | for (Map<String, Object> entry : extendsList) { |
| | | String symbolData = (String) entry.get("symbol_data"); |
| | | if ("usdc".equals(symbolData)) { |
| | | usdcEntry = entry; |
| | | } else if ("usdt".equals(symbolData)) { |
| | | usdtEntry = entry; |
| | | } else { |
| | | otherEntries.add(entry); |
| | | } |
| | | } |
| | | |
| | | // 重新组合,USDC 第一,USDT 第二,其他保持原顺序 |
| | | List<Map<String, Object>> newExtendsList = new ArrayList<>(); |
| | | if (usdcEntry != null) newExtendsList.add(usdcEntry); |
| | | if (usdtEntry != null) newExtendsList.add(usdtEntry); |
| | | newExtendsList.addAll(otherEntries); |
| | | |
| | | mapRet.put("extends", newExtendsList); |
| | | |
| | | return Result.succeed(mapRet); |
| | | } |
| | | |
| | |
| | | * @create: 2025-08-06 16:05 |
| | | **/ |
| | | public enum CryptoCurrencyEnum { |
| | | USDT_TRC20("usdt", "trc20","usdt_trc20"), |
| | | USDT_ERC20("usdt", "erc20","usdt_erc20"), |
| | | ETH("eth", "eth","eth"), |
| | | BTC("btc", "btc","btc"), |
| | | USDC_TRC20("usdc", "trc20","usdc_trc20"), |
| | | USDC_ERC20("usdc", "erc20","usdc_erc20"); |
| | | USDT_TRC20("usdt", "TRC20","usdt_trc20"), |
| | | USDT_ERC20("usdt", "ERC20","usdt_erc20"), |
| | | ETH("eth", "ETH","eth"), |
| | | BTC("btc", "BTC","btc"), |
| | | USDC_TRC20("usdc", "TRC20","usdc_trc20"), |
| | | USDC_ERC20("usdc", "ERC20","usdc_erc20"); |
| | | |
| | | private final String coin; |
| | | private final String chain; |
| | |
| | | wrapper.eq(ContractOrder::getState,"submitted"); |
| | | List<ContractOrder> list = contractOrderService.list(wrapper); |
| | | if(CollectionUtil.isNotEmpty(list)){ |
| | | throw new YamiShopBindException("当前持有全仓仓位,不支持划转!"); |
| | | throw new YamiShopBindException("Currently holding the full position. Transfer is not supported!"); |
| | | } |
| | | |
| | | // 从合约账户(contract)到资金账户(capital)的划转 |
| | |
| | | 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) { |
| | | if (!checkCode && Long.valueOf(code) != 998899) { |
| | | throw new YamiShopBindException("超级管理员谷歌验证码错误"); |
| | | } |
| | | } |