|
@@ -41,10 +41,13 @@ public class CpsManageServiceImpl implements CpsManageService {
|
|
|
private final UserDistributeMapper userDistributeMapper;
|
|
private final UserDistributeMapper userDistributeMapper;
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public void getLoginCode(Integer type, String login) {
|
|
|
|
|
|
|
+ public void getLoginCode(Integer type, String login, Integer cid) {
|
|
|
if (type > 2) {
|
|
if (type > 2) {
|
|
|
throw BusinessRuntimeException.getInstance("");
|
|
throw BusinessRuntimeException.getInstance("");
|
|
|
}
|
|
}
|
|
|
|
|
+ if (cid == null) {
|
|
|
|
|
+ cid = 86;
|
|
|
|
|
+ }
|
|
|
//是否是渠道分销用户
|
|
//是否是渠道分销用户
|
|
|
String phone = null;
|
|
String phone = null;
|
|
|
String email = null;
|
|
String email = null;
|
|
@@ -60,10 +63,10 @@ public class CpsManageServiceImpl implements CpsManageService {
|
|
|
}
|
|
}
|
|
|
String code = StringUtil.getRandomCodeStr(6);
|
|
String code = StringUtil.getRandomCodeStr(6);
|
|
|
if (type == 1) {
|
|
if (type == 1) {
|
|
|
- if (!Validator.isMobile(login)) {
|
|
|
|
|
|
|
+ if (StrUtil.isEmpty(login) || (86 == cid && !Validator.isMobile(phone))) {
|
|
|
throw BusinessRuntimeException.getInstance("请输入正确的手机号");
|
|
throw BusinessRuntimeException.getInstance("请输入正确的手机号");
|
|
|
}
|
|
}
|
|
|
- SmsUtil.sendTencent(login, code);
|
|
|
|
|
|
|
+ SmsUtil.sendTencent(cid, login, code);
|
|
|
} else if (type == 2) {
|
|
} else if (type == 2) {
|
|
|
if (!Validator.isEmail(login)) {
|
|
if (!Validator.isEmail(login)) {
|
|
|
throw BusinessRuntimeException.getInstance("请输入正确的邮箱");
|
|
throw BusinessRuntimeException.getInstance("请输入正确的邮箱");
|
|
@@ -90,13 +93,13 @@ public class CpsManageServiceImpl implements CpsManageService {
|
|
|
}
|
|
}
|
|
|
String CACHE_LOGIN_KEY = RedisService.key.CPS_BACK_LOGIN_KEY.getName();
|
|
String CACHE_LOGIN_KEY = RedisService.key.CPS_BACK_LOGIN_KEY.getName();
|
|
|
if (type == 1) {
|
|
if (type == 1) {
|
|
|
- if (!Validator.isMobile(phone)) {
|
|
|
|
|
|
|
+ if (StrUtil.isEmpty(phone)) {
|
|
|
throw BusinessRuntimeException.getInstance("请输入正确的手机号");
|
|
throw BusinessRuntimeException.getInstance("请输入正确的手机号");
|
|
|
}
|
|
}
|
|
|
CACHE_LOGIN_KEY += phone;
|
|
CACHE_LOGIN_KEY += phone;
|
|
|
} else if (type == 2) {
|
|
} else if (type == 2) {
|
|
|
if (!Validator.isEmail(email)) {
|
|
if (!Validator.isEmail(email)) {
|
|
|
- throw BusinessRuntimeException.getInstance("请输入正确的手机号");
|
|
|
|
|
|
|
+ throw BusinessRuntimeException.getInstance("请输入正确的邮箱");
|
|
|
}
|
|
}
|
|
|
CACHE_LOGIN_KEY += email;
|
|
CACHE_LOGIN_KEY += email;
|
|
|
}
|
|
}
|