|
@@ -117,7 +117,7 @@ public class BaseServiceImpl implements BaseService {
|
|
|
* 获取短信验证码
|
|
|
*
|
|
|
* @param mobile 手机号
|
|
|
- * @param activateCodeType 1:找回密码,2:手机号注册机构,3:供应商注册,4:修改手机号-旧手机验证码,5:修改手机号-新手机验证码,7:手机验证码登录
|
|
|
+ * @param activateCodeType 1:找回密码,2:手机号注册机构,3:供应商注册,4:修改手机号-旧手机验证码,5:修改手机号-新手机验证码,7:手机验证码登录,8:联合丽格登录验证,9:联合丽格找回密码,10:联合丽格更换手机号
|
|
|
* @param platformType 0:www,1:crm/h5,2:小程序
|
|
|
* @param isCheckCaptcha 是否检查图片验证码,0:检查,1:不检查
|
|
|
* @param imgCode 图片验证码
|
|
@@ -178,19 +178,28 @@ public class BaseServiceImpl implements BaseService {
|
|
|
String content = "验证码" + randomCode + ",您正在尝试变更重要信息,请妥善保管账户信息。";
|
|
|
sendFlag = isBeta || remoteCallService.remoteSendSms(0, 1, mobile, content);
|
|
|
codeTypeTxt = "更换联系人(旧手机号验证码)";
|
|
|
- } else if (5 == activateCodeType) {
|
|
|
+ } else if (5 == activateCodeType || 10 == activateCodeType) {
|
|
|
if (null != userId && userId > 0) {
|
|
|
return ResponseJson.error("该手机号已被使用");
|
|
|
}
|
|
|
- // 您正在更换联系人手机号,您的验证码为:${code}。
|
|
|
- String content = "验证码" + randomCode + ",您正在尝试变更重要信息,请妥善保管账户信息。";
|
|
|
+ String content = "";
|
|
|
+ // 采美
|
|
|
+ if (5 == activateCodeType) {
|
|
|
+ // 您正在更换联系人手机号,您的验证码为:${code}。
|
|
|
+ content = "验证码" + randomCode + ",您正在尝试变更重要信息,请妥善保管账户信息。";
|
|
|
+ }
|
|
|
+ // 联合丽格
|
|
|
+ if (10 == activateCodeType){
|
|
|
+ // 您正在更改手机号,验证码为:{s6},5分钟内有效,请勿泄漏他人。
|
|
|
+ content = "您正在更改手机号,验证码为:" + randomCode + ",5分钟内有效,请勿泄漏他人。";
|
|
|
+ }
|
|
|
sendFlag = isBeta || remoteCallService.remoteSendSms(0, 1, mobile, content);
|
|
|
codeTypeTxt = "更换联系人(新手机号验证码)";
|
|
|
} else if (6 == activateCodeType) {
|
|
|
String content = "您正在采美平台发布二手商品,您的验证码为:" + randomCode + ",10分钟内有效,请勿泄露他人。";
|
|
|
sendFlag = isBeta || remoteCallService.remoteSendSms(0, 1, mobile, content);
|
|
|
codeTypeTxt = "更换联系人(旧手机号验证码)";
|
|
|
- } else if (7 == activateCodeType) {
|
|
|
+ } else if (7 == activateCodeType || 8 == activateCodeType) {
|
|
|
// 校验是否发送验证码
|
|
|
/*Object resCode = redisService.get("code:" + mobile);
|
|
|
long expireTime = redisService.getExpireTime("code:" + mobile);
|
|
@@ -201,12 +210,28 @@ public class BaseServiceImpl implements BaseService {
|
|
|
redisService.remove("code:"+ mobile);
|
|
|
Integer dbUserId = null;
|
|
|
// 根据手机号查询用户Id
|
|
|
- dbUserId = baseMapper.getUserIdByMobile(mobile);
|
|
|
- if (dbUserId == null) {
|
|
|
- return ResponseJson.error("该手机号暂未注册");
|
|
|
+ String content = "";
|
|
|
+ if (7 == activateCodeType) {
|
|
|
+ // 采美系统登陆发送短信
|
|
|
+ dbUserId = baseMapper.getUserIdByMobile(mobile);
|
|
|
+ if (dbUserId == null) {
|
|
|
+ return ResponseJson.error("该手机号暂未注册");
|
|
|
+ }
|
|
|
+ // 您正在操作登录采美商城,验证码:{s6},请在5分钟内完成验证。如非本人操作,请忽略本短信。
|
|
|
+ content = "您正在操作登录采美商城,验证码:" + randomCode + ",请在5分钟内完成验证。如非本人操作,请忽略本短信。";
|
|
|
+ codeTypeTxt = "登录采美商城";
|
|
|
+ } else if (8 == activateCodeType){
|
|
|
+ // 联合丽格登录发送短信
|
|
|
+ dbUserId = baseMapper.getUserIdByOrganize(1,mobile);
|
|
|
+ if (dbUserId == null) {
|
|
|
+ return ResponseJson.error("该手机号暂未注册");
|
|
|
+ }
|
|
|
+ // 欢迎登录联合丽格,您的验证码为:{s6},5分钟内有效,请勿泄漏他人。
|
|
|
+ content = "欢迎登录联合丽格,您的验证码为:" + randomCode + ",5分钟内有效,请勿泄漏他人。";
|
|
|
+ codeTypeTxt = "登录联合丽格";
|
|
|
+ } else {
|
|
|
+ return ResponseJson.error("参数错误:activateCodeType");
|
|
|
}
|
|
|
- // 您正在操作登录采美商城,验证码:{s6},请在5分钟内完成验证。如非本人操作,请忽略本短信。
|
|
|
- String content = "您正在操作登录采美商城,验证码:"+ randomCode +",请在5分钟内完成验证。如非本人操作,请忽略本短信。";
|
|
|
boolean smsFlag = isBeta || remoteCallService.remoteSendSms(0,1,mobile,content);
|
|
|
if (!smsFlag) {
|
|
|
// 短信发送失败重试一次
|
|
@@ -214,11 +239,26 @@ public class BaseServiceImpl implements BaseService {
|
|
|
}
|
|
|
if (smsFlag) {
|
|
|
redisService.set("code:"+ mobile, randomCode,300L);
|
|
|
- log.info("登录短信,发送到"+ mobile + "的验证码为:"+ randomCode);
|
|
|
+ log.info(codeTypeTxt + "登录短信,发送到"+ mobile + "的验证码为:"+ randomCode);
|
|
|
return ResponseJson.success("发送验证码成功");
|
|
|
} else {
|
|
|
+ log.info(codeTypeTxt + ",验证码发送失败!");
|
|
|
return ResponseJson.error("发送验证码失败,请稍后再试");
|
|
|
}
|
|
|
+ } else if (9 == activateCodeType){
|
|
|
+ // 联合丽格登录发送短信
|
|
|
+ Integer dbUserId = baseMapper.getUserIdByOrganize(1,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 {
|
|
|
return ResponseJson.error("参数错误:activateCodeType");
|
|
|
}
|
|
@@ -545,13 +585,15 @@ public class BaseServiceImpl implements BaseService {
|
|
|
if (result != null) {
|
|
|
return ResponseJson.error(result);
|
|
|
}
|
|
|
- String smsCode = (String) redisService.get("code:" + mobileDto.getMobile());
|
|
|
- // 开发 和 测试环境 固定短信验证码 666666
|
|
|
- if ("dev".equals(profile) || "beta".equals(profile)) {
|
|
|
- smsCode = (null != smsCode && !"null".equals(smsCode) ? smsCode : "666666");
|
|
|
- }
|
|
|
- if (!mobileDto.getSmsCode().equals(smsCode)) {
|
|
|
- return ResponseJson.error("旧手机验证码错误");
|
|
|
+ if (0 == mobileDto.getOrganizeId()) {
|
|
|
+ String smsCode = (String) redisService.get("code:" + mobileDto.getMobile());
|
|
|
+ // 开发 和 测试环境 固定短信验证码 666666
|
|
|
+ if ("dev".equals(profile) || "beta".equals(profile)) {
|
|
|
+ smsCode = (null != smsCode && !"null".equals(smsCode) ? smsCode : "666666");
|
|
|
+ }
|
|
|
+ if (!mobileDto.getSmsCode().equals(smsCode)) {
|
|
|
+ return ResponseJson.error("旧手机验证码错误");
|
|
|
+ }
|
|
|
}
|
|
|
UserLoginVo user = loginMapper.getLoginUserByUserId(mobileDto.getUserId());
|
|
|
if (null == user) {
|