|
@@ -117,7 +117,7 @@ public class BaseServiceImpl implements BaseService {
|
|
* 获取短信验证码
|
|
* 获取短信验证码
|
|
*
|
|
*
|
|
* @param mobile 手机号
|
|
* @param mobile 手机号
|
|
- * @param activateCodeType 1:找回密码,2:手机号注册机构,3:供应商注册,4:修改手机号-旧手机验证码,5:修改手机号-新手机验证码,7:手机验证码登录,8:联合丽格登录验证,9:联合丽格找回密码,10:联合丽格更换手机号
|
|
|
|
|
|
+ * @param activateCodeType 1:找回密码,2:手机号注册机构,3:供应商注册,4:修改手机号-旧手机验证码,5:修改手机号-新手机验证码,7:手机验证码登录,8:联合丽格注册,9:联合丽格登录验证,10:联合丽格找回密码,11:联合丽格更换手机号
|
|
* @param platformType 0:www,1:crm/h5,2:小程序
|
|
* @param platformType 0:www,1:crm/h5,2:小程序
|
|
* @param isCheckCaptcha 是否检查图片验证码,0:检查,1:不检查
|
|
* @param isCheckCaptcha 是否检查图片验证码,0:检查,1:不检查
|
|
* @param imgCode 图片验证码
|
|
* @param imgCode 图片验证码
|
|
@@ -178,7 +178,7 @@ public class BaseServiceImpl implements BaseService {
|
|
String content = "验证码" + randomCode + ",您正在尝试变更重要信息,请妥善保管账户信息。";
|
|
String content = "验证码" + randomCode + ",您正在尝试变更重要信息,请妥善保管账户信息。";
|
|
sendFlag = isBeta || remoteCallService.remoteSendSms(0, 1, mobile, content);
|
|
sendFlag = isBeta || remoteCallService.remoteSendSms(0, 1, mobile, content);
|
|
codeTypeTxt = "更换联系人(旧手机号验证码)";
|
|
codeTypeTxt = "更换联系人(旧手机号验证码)";
|
|
- } else if (5 == activateCodeType || 10 == activateCodeType) {
|
|
|
|
|
|
+ } else if (5 == activateCodeType || 11 == activateCodeType) {
|
|
if (null != userId && userId > 0) {
|
|
if (null != userId && userId > 0) {
|
|
return ResponseJson.error("该手机号已被使用");
|
|
return ResponseJson.error("该手机号已被使用");
|
|
}
|
|
}
|
|
@@ -189,7 +189,7 @@ public class BaseServiceImpl implements BaseService {
|
|
content = "验证码" + randomCode + ",您正在尝试变更重要信息,请妥善保管账户信息。";
|
|
content = "验证码" + randomCode + ",您正在尝试变更重要信息,请妥善保管账户信息。";
|
|
}
|
|
}
|
|
// 联合丽格
|
|
// 联合丽格
|
|
- if (10 == activateCodeType){
|
|
|
|
|
|
+ if (11 == activateCodeType){
|
|
// 您正在更改手机号,验证码为:{s6},5分钟内有效,请勿泄漏他人。
|
|
// 您正在更改手机号,验证码为:{s6},5分钟内有效,请勿泄漏他人。
|
|
content = "您正在更改手机号,验证码为:" + randomCode + ",5分钟内有效,请勿泄漏他人。";
|
|
content = "您正在更改手机号,验证码为:" + randomCode + ",5分钟内有效,请勿泄漏他人。";
|
|
}
|
|
}
|
|
@@ -199,7 +199,7 @@ public class BaseServiceImpl implements BaseService {
|
|
String content = "您正在采美平台发布二手商品,您的验证码为:" + randomCode + ",10分钟内有效,请勿泄露他人。";
|
|
String content = "您正在采美平台发布二手商品,您的验证码为:" + randomCode + ",10分钟内有效,请勿泄露他人。";
|
|
sendFlag = isBeta || remoteCallService.remoteSendSms(0, 1, mobile, content);
|
|
sendFlag = isBeta || remoteCallService.remoteSendSms(0, 1, mobile, content);
|
|
codeTypeTxt = "更换联系人(旧手机号验证码)";
|
|
codeTypeTxt = "更换联系人(旧手机号验证码)";
|
|
- } else if (7 == activateCodeType || 8 == activateCodeType) {
|
|
|
|
|
|
+ } else if (7 == activateCodeType || 9 == activateCodeType) {
|
|
// 校验是否发送验证码
|
|
// 校验是否发送验证码
|
|
/*Object resCode = redisService.get("code:" + mobile);
|
|
/*Object resCode = redisService.get("code:" + mobile);
|
|
long expireTime = redisService.getExpireTime("code:" + mobile);
|
|
long expireTime = redisService.getExpireTime("code:" + mobile);
|
|
@@ -220,9 +220,9 @@ public class BaseServiceImpl implements BaseService {
|
|
// 您正在操作登录采美商城,验证码:{s6},请在5分钟内完成验证。如非本人操作,请忽略本短信。
|
|
// 您正在操作登录采美商城,验证码:{s6},请在5分钟内完成验证。如非本人操作,请忽略本短信。
|
|
content = "您正在操作登录采美商城,验证码:" + randomCode + ",请在5分钟内完成验证。如非本人操作,请忽略本短信。";
|
|
content = "您正在操作登录采美商城,验证码:" + randomCode + ",请在5分钟内完成验证。如非本人操作,请忽略本短信。";
|
|
codeTypeTxt = "登录采美商城";
|
|
codeTypeTxt = "登录采美商城";
|
|
- } else if (8 == activateCodeType){
|
|
|
|
|
|
+ } else if (9 == activateCodeType){
|
|
// 联合丽格登录发送短信
|
|
// 联合丽格登录发送短信
|
|
- dbUserId = baseMapper.getUserIdByOrganize(1,mobile);
|
|
|
|
|
|
+ dbUserId = baseMapper.getUserIdByOrganize(4,mobile);
|
|
if (dbUserId == null) {
|
|
if (dbUserId == null) {
|
|
return ResponseJson.error("该手机号暂未注册");
|
|
return ResponseJson.error("该手机号暂未注册");
|
|
}
|
|
}
|
|
@@ -245,9 +245,23 @@ public class BaseServiceImpl implements BaseService {
|
|
log.info(codeTypeTxt + ",验证码发送失败!");
|
|
log.info(codeTypeTxt + ",验证码发送失败!");
|
|
return ResponseJson.error("发送验证码失败,请稍后再试");
|
|
return ResponseJson.error("发送验证码失败,请稍后再试");
|
|
}
|
|
}
|
|
- } else if (9 == activateCodeType){
|
|
|
|
- // 联合丽格登录发送短信
|
|
|
|
- Integer dbUserId = baseMapper.getUserIdByOrganize(1,mobile);
|
|
|
|
|
|
+ } else if (8 == activateCodeType) {
|
|
|
|
+ // 联合丽格注册发送短信
|
|
|
|
+ Integer dbUserId = baseMapper.getUserIdByOrganize(4,mobile);
|
|
|
|
+ if (dbUserId == null) {
|
|
|
|
+ return ResponseJson.error("该手机号暂未注册");
|
|
|
|
+ }
|
|
|
|
+ // 您的验证码为:{s6},5分钟内有效,请勿泄漏他人。
|
|
|
|
+ String content = "您的验证码为:" + randomCode + ",5分钟内有效,请勿泄漏他人。";
|
|
|
|
+ sendFlag = isBeta || remoteCallService.remoteSendSms(0,1,mobile,content);
|
|
|
|
+ if (!sendFlag) {
|
|
|
|
+ // 短信发送失败重试一次
|
|
|
|
+ sendFlag = remoteCallService.remoteSendSms(0,1,mobile,content);
|
|
|
|
+ }
|
|
|
|
+ codeTypeTxt = "联合丽格注册";
|
|
|
|
+ } else if (10 == activateCodeType){
|
|
|
|
+ // 联合丽格找回密码发送短信
|
|
|
|
+ Integer dbUserId = baseMapper.getUserIdByOrganize(4,mobile);
|
|
if (dbUserId == null) {
|
|
if (dbUserId == null) {
|
|
return ResponseJson.error("该手机号暂未注册");
|
|
return ResponseJson.error("该手机号暂未注册");
|
|
}
|
|
}
|
|
@@ -266,7 +280,10 @@ public class BaseServiceImpl implements BaseService {
|
|
if (6 == activateCodeType) {
|
|
if (6 == activateCodeType) {
|
|
//二手验证码10分钟有效期
|
|
//二手验证码10分钟有效期
|
|
redisService.set("code:" + mobile, randomCode, 600L);
|
|
redisService.set("code:" + mobile, randomCode, 600L);
|
|
- } else {
|
|
|
|
|
|
+ } else if (8 == activateCodeType || 10 == activateCodeType || 11 == activateCodeType) {
|
|
|
|
+ // 联合丽格验证码5分钟有效期
|
|
|
|
+ redisService.set("code:" + mobile, randomCode, 300L);
|
|
|
|
+ }else {
|
|
redisService.set("code:" + mobile, randomCode, 1800L);
|
|
redisService.set("code:" + mobile, randomCode, 1800L);
|
|
}
|
|
}
|
|
log.info(codeTypeTxt + ",发送到:" + mobile + "的短信验证码为: " + randomCode);
|
|
log.info(codeTypeTxt + ",发送到:" + mobile + "的短信验证码为: " + randomCode);
|
|
@@ -565,15 +582,9 @@ public class BaseServiceImpl implements BaseService {
|
|
@Override
|
|
@Override
|
|
public ResponseJson updateMobile(MobileDto mobileDto) {
|
|
public ResponseJson updateMobile(MobileDto mobileDto) {
|
|
// 参数校验
|
|
// 参数校验
|
|
- if (StringUtils.isBlank(mobileDto.getMobile())) {
|
|
|
|
- return ResponseJson.error("参数异常:旧手机号不能为空!");
|
|
|
|
- }
|
|
|
|
if (StringUtils.isBlank(mobileDto.getNewMobile())) {
|
|
if (StringUtils.isBlank(mobileDto.getNewMobile())) {
|
|
return ResponseJson.error("参数异常:新手机号不能为空!");
|
|
return ResponseJson.error("参数异常:新手机号不能为空!");
|
|
}
|
|
}
|
|
- if (StringUtils.isBlank(mobileDto.getSmsCode())) {
|
|
|
|
- return ResponseJson.error("参数异常:旧手机号验证码不能为空!");
|
|
|
|
- }
|
|
|
|
if (StringUtils.isBlank(mobileDto.getNewSmsCode())) {
|
|
if (StringUtils.isBlank(mobileDto.getNewSmsCode())) {
|
|
return ResponseJson.error("参数异常:新手机号验证码不能为空!");
|
|
return ResponseJson.error("参数异常:新手机号验证码不能为空!");
|
|
}
|
|
}
|
|
@@ -586,6 +597,12 @@ public class BaseServiceImpl implements BaseService {
|
|
return ResponseJson.error(result);
|
|
return ResponseJson.error(result);
|
|
}
|
|
}
|
|
if (0 == mobileDto.getOrganizeId()) {
|
|
if (0 == mobileDto.getOrganizeId()) {
|
|
|
|
+ if (StringUtils.isBlank(mobileDto.getMobile())) {
|
|
|
|
+ return ResponseJson.error("参数异常:旧手机号不能为空!");
|
|
|
|
+ }
|
|
|
|
+ if (StringUtils.isBlank(mobileDto.getSmsCode())) {
|
|
|
|
+ return ResponseJson.error("参数异常:旧手机号验证码不能为空!");
|
|
|
|
+ }
|
|
String smsCode = (String) redisService.get("code:" + mobileDto.getMobile());
|
|
String smsCode = (String) redisService.get("code:" + mobileDto.getMobile());
|
|
// 开发 和 测试环境 固定短信验证码 666666
|
|
// 开发 和 测试环境 固定短信验证码 666666
|
|
if ("dev".equals(profile) || "beta".equals(profile)) {
|
|
if ("dev".equals(profile) || "beta".equals(profile)) {
|
|
@@ -610,7 +627,7 @@ public class BaseServiceImpl implements BaseService {
|
|
//供应商修改手机号
|
|
//供应商修改手机号
|
|
baseMapper.updateShopMobileByShopId(mobileDto.getNewMobile(), user.getShopId());
|
|
baseMapper.updateShopMobileByShopId(mobileDto.getNewMobile(), user.getShopId());
|
|
} else {
|
|
} else {
|
|
- //供应商修改手机号
|
|
|
|
|
|
+ //机构修改手机号
|
|
baseMapper.updateClubMobileByClubId(mobileDto.getNewMobile(), user.getClubId());
|
|
baseMapper.updateClubMobileByClubId(mobileDto.getNewMobile(), user.getClubId());
|
|
}
|
|
}
|
|
return ResponseJson.success();
|
|
return ResponseJson.success();
|