From df51a79a9e09e0273cc50d966ad136efe8b99100 Mon Sep 17 00:00:00 2001
From: xiaoyong931011 <15274802129@163.com>
Date: Tue, 01 Mar 2022 10:46:32 +0800
Subject: [PATCH] Merge branch 'bea' of http://120.27.238.55:7000/r/exchange into bea

---
 src/main/java/com/xcong/excoin/common/system/service/impl/CommonServiceImpl.java |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/src/main/java/com/xcong/excoin/common/system/service/impl/CommonServiceImpl.java b/src/main/java/com/xcong/excoin/common/system/service/impl/CommonServiceImpl.java
index 265b41a..3530375 100644
--- a/src/main/java/com/xcong/excoin/common/system/service/impl/CommonServiceImpl.java
+++ b/src/main/java/com/xcong/excoin/common/system/service/impl/CommonServiceImpl.java
@@ -25,6 +25,9 @@
 
     @Override
     public boolean verifyCode(String account, String code) {
+        if(StrUtil.isBlank(code)){
+            return false;
+        }
         String cacheCode = redisUtils.getString(AppContants.VERIFY_CODE_PREFIX + account);
         if (StrUtil.isBlank(cacheCode)) {
             return false;
@@ -38,6 +41,26 @@
     }
 
     @Override
+    public boolean mutiVerifyCode(String email, String emailCode, String phone, String phoneCode) {
+        if (StrUtil.isBlank(emailCode) || StrUtil.isBlank(phoneCode)) {
+            return false;
+        }
+
+        String cacheEmailCode = redisUtils.getString(AppContants.VERIFY_CODE_PREFIX + email);
+        String cachePhoneCode = redisUtils.getString(AppContants.VERIFY_CODE_PREFIX + phone);
+        if (StrUtil.isBlank(cacheEmailCode) || StrUtil.isBlank(cachePhoneCode)) {
+            return false;
+        }
+
+        if (emailCode.equals(cacheEmailCode) && phoneCode.equals(cachePhoneCode)) {
+            redisUtils.del(AppContants.VERIFY_CODE_PREFIX + email);
+            redisUtils.del(AppContants.VERIFY_CODE_PREFIX + phone);
+            return true;
+        }
+        return false;
+    }
+
+    @Override
     public String generateOrderNo(Long mid) {
         StringBuilder orderNo = new StringBuilder();
         String date = DateUtil.format(new Date(), "yyyyMMdd");

--
Gitblit v1.9.1