src/main/java/com/xcong/excoin/common/system/controller/CommonController.java
@@ -10,6 +10,7 @@ import com.xcong.excoin.utils.OssUtils; import com.xcong.excoin.utils.RedisUtils; import com.xcong.excoin.utils.SmsUtils; import com.xcong.excoin.utils.mail.SmsSend; import com.xcong.excoin.utils.mail.SubMailSend; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -58,8 +59,8 @@ // 发送手机验证码 if (AppContants.ACCOUNT_TYPE_MOBILE.equals(type)) { Map<String, Object> result = SmsUtils.sendVerifyCode(account, code); if (SUCCESS.equals(result.get("returnstatus"))) { boolean result = SmsSend.sendVerifyCode(account, code.toString(), 2); if (result) { Map<String, Object> map = new HashMap<>(); boolean flag = redisUtils.set(AppContants.VERIFY_CODE_PREFIX + account, code, 120); map.put("code", flag); src/main/java/com/xcong/excoin/common/system/service/impl/CommonServiceImpl.java
@@ -26,11 +26,9 @@ @Override public boolean verifyCode(String account, String code) { String cacheCode = redisUtils.getString(AppContants.VERIFY_CODE_PREFIX + account); log.info("---->{}", cacheCode); if (StrUtil.isBlank(cacheCode)) { return false; } return code.equals(cacheCode); } src/main/java/com/xcong/excoin/utils/mail/SmsSend.java
@@ -3,7 +3,6 @@ import net.sf.json.JSONObject; import org.apache.http.HttpEntity; import org.apache.http.HttpResponse; import org.apache.http.client.ClientProtocolException; import org.apache.http.client.methods.HttpGet; import org.apache.http.client.methods.HttpPost; import org.apache.http.entity.ContentType; @@ -99,7 +98,6 @@ /** * 获取时间戳 * * @return */ private static String getTimestamp() { CloseableHttpClient closeableHttpClient = HttpClientBuilder.create().build();