|
@@ -10,7 +10,7 @@ import com.fdkankan.common.util.NumberUtils;
|
|
|
import com.fdkankan.common.util.SecurityUtil;
|
|
|
import com.fdkankan.fyun.face.FYunFileServiceInterface;
|
|
|
import com.fdkankan.image.MatrixToImageWriterUtil;
|
|
|
-import com.fdkankan.sms.SmsService;
|
|
|
+import com.fdkankan.sms.SmsServiceHuawei;
|
|
|
import com.fdkankan.ucenter.common.MailUtil;
|
|
|
import com.fdkankan.ucenter.common.constants.ConstantFilePath;
|
|
|
import com.fdkankan.redis.constant.RedisKey;
|
|
@@ -33,6 +33,7 @@ import java.util.Date;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.Map;
|
|
|
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -41,6 +42,7 @@ import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
|
@Service
|
|
|
+@Slf4j
|
|
|
public class LoginService {
|
|
|
|
|
|
@Autowired
|
|
@@ -48,7 +50,7 @@ public class LoginService {
|
|
|
@Autowired
|
|
|
private RedisUtil redisUtil;
|
|
|
@Autowired
|
|
|
- private SmsService smsService;
|
|
|
+ private SmsServiceHuawei smsService;
|
|
|
@Autowired
|
|
|
private ICameraService cameraService;
|
|
|
@Autowired
|
|
@@ -126,26 +128,10 @@ public class LoginService {
|
|
|
throw new BusinessException(LoginConstant.FAILURE_CODE_3033, String.valueOf(value));
|
|
|
}
|
|
|
String code = String.valueOf((int)((Math.random()*9+1)*100000));
|
|
|
- if(StringUtils.isBlank(areaNum)){
|
|
|
- areaNum = "86";
|
|
|
- }
|
|
|
- if ("86".equals(areaNum)){
|
|
|
- String sendCode = null;
|
|
|
- try {
|
|
|
- sendCode = smsService.sendSms(phoneNum, "{\"code\":\"" + code + "\"}", cnCode);
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
- if("isv.BUSINESS_LIMIT_CONTROL".equals(sendCode)){
|
|
|
- throw new BusinessException(LoginConstant.FAILURE_CODE_3023, LoginConstant.FAILURE_MSG_3023);
|
|
|
- }
|
|
|
- }else{
|
|
|
- try{
|
|
|
- smsService.sendSMSMessage(areaNum + phoneNum, code);
|
|
|
- }catch (Exception e){
|
|
|
- e.printStackTrace();
|
|
|
- throw new BusinessException(LoginConstant.FAILURE_CODE_3013, LoginConstant.FAILURE_MSG_3013);
|
|
|
- }
|
|
|
+ try {
|
|
|
+ smsService.sendSms(phoneNum, code);
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.info("短信发送失败:{}",e);
|
|
|
}
|
|
|
if(redisUtil.hasKey(redisKeyMsg)){
|
|
|
redisUtil.del(redisKeyMsg);
|