admin
2020-08-26 26f7accb815f55f18f8eedfca4324700a96884ec
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/SMSController.java
@@ -4,6 +4,7 @@
import javax.annotation.Resource;
import com.yeshi.fanli.entity.SystemEnum;
import com.yeshi.fanli.util.*;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@@ -64,8 +65,7 @@
            out.print(JsonUtil.loadFalseResult(4, "电话号码格式不正确"));
            return;
         }
         smsService.sendLoginVCode(phone, 6);
            smsService.sendLoginVCode(acceptData.getSystem(), phone, 6);
         out.print(JsonUtil.loadTrueResult("发送成功"));
      } catch (SMSException e) {
         out.print(JsonUtil.loadFalseResult(e.getCode(), e.getMsg()));
@@ -77,7 +77,6 @@
    * 
    * @param acceptData
    * @param phone
    * @param uid
    * @param out
    */
   @RequestMapping(value = "sendMSMLogin", method = RequestMethod.POST)
@@ -93,7 +92,7 @@
         return;
      }
      sendMSNnew(phone, slideVerify, 1, StringUtil.Md5(phone + "-" + acceptData.getDevice()), out);
        sendMSNnew(acceptData.getSystem(), phone, slideVerify, 1, StringUtil.Md5(phone + "-" + acceptData.getDevice()), out);
   }
   /**
@@ -136,10 +135,10 @@
         return;
      }
      sendMSNnew(phone, slideVerify, 2, StringUtil.Md5(phone + "-" + acceptData.getDevice()), out);
        sendMSNnew(acceptData.getSystem(), phone, slideVerify, 2, StringUtil.Md5(phone + "-" + acceptData.getDevice()), out);
   }
   public void sendMSNnew(String phone, boolean slideVerify, int type, String key, PrintWriter out) {
    public void sendMSNnew(SystemEnum system, String phone, boolean slideVerify, int type, String key, PrintWriter out) {
      try {
         int count = 0;
         String cachekey = null;
@@ -176,10 +175,10 @@
         if (type == 1) {
            // 登录验证码
            smsService.sendLoginVCode(phone, 4);
                smsService.sendLoginVCode(system, phone, 4);
         } else if (type == 2) {
            // 绑定验证码
            smsService.sendBindVCode(phone, 4);
                smsService.sendBindVCode(system, phone, 4);
         }
         out.print(JsonUtil.loadTrueResult("发送成功"));
@@ -193,9 +192,9 @@
   }
   
   
   /**
    * 注销账户短信验证
     *
    * @param acceptData
    * @param uid
    * @param phone
@@ -246,7 +245,7 @@
         count++;
         redisManager.cacheCommonString(cachekey, count + "", 60 * 60);
         // 发送验证码
         smsService.sendRemoveVCode(phone, 4);
            smsService.sendRemoveVCode(acceptData.getSystem(), phone, 4);
         JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("发送成功"));
      } catch (SMSException e) {
         JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getCode(), e.getMsg()));