|
@@ -14,6 +14,7 @@ import com.caimei.service.auth.AuthProductService;
|
|
|
import com.caimei.service.auth.AuthService;
|
|
|
import com.caimei.service.wechat.RegisterService;
|
|
|
import com.caimei.utils.Md5Util;
|
|
|
+import com.caimei.utils.SmsUtils;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -47,7 +48,7 @@ public class RegisterServiceImpl implements RegisterService {
|
|
|
private AuthProductService authProductService;
|
|
|
|
|
|
@Override
|
|
|
- public ResponseJson<WxClubUserVo> simpleRegister(String mobile, String verifyCode, String password, Integer authUserId, Integer authId) {
|
|
|
+ public ResponseJson<WxClubUserVo> simpleRegister(String mobile, String verifyCode, String password, Integer authUserId, Integer authId, Integer registerType) {
|
|
|
// 校验手机号
|
|
|
WxClubUserVo clubUserVo = clubMapper.getWxClubUser(mobile, null, authUserId, null, null);
|
|
|
if (null != clubUserVo) {
|
|
@@ -68,6 +69,10 @@ public class RegisterServiceImpl implements RegisterService {
|
|
|
if (!verifyCode.equals(redisVerifyCode)) {
|
|
|
return ResponseJson.error("验证码错误,请重新输入", null);
|
|
|
}
|
|
|
+ if (2 == registerType) {
|
|
|
+ // 验证码注册,默认密码
|
|
|
+ password = "rzt123456";
|
|
|
+ }
|
|
|
String md5Password = Md5Util.md5(password);
|
|
|
/*
|
|
|
* 构建机构用户数据
|
|
@@ -90,6 +95,16 @@ public class RegisterServiceImpl implements RegisterService {
|
|
|
clubUser.setAddTime(new Date());
|
|
|
clubMapper.insertClubUser(clubUser);
|
|
|
clubUserVo = clubMapper.getWxClubUser(mobile, null, authUserId, null, null);
|
|
|
+ if (2 == registerType) {
|
|
|
+ // 验证码注册,推送默认密码短信
|
|
|
+ String content = "您认证通登录密码为:rzt123456";
|
|
|
+ Boolean sendSms = SmsUtils.sendSms(11, mobile, content);
|
|
|
+ if (!sendSms) {
|
|
|
+ log.info("机构用户验证码注册-密码发送失败,手机号:" + mobile);
|
|
|
+ } else {
|
|
|
+ log.info("机构用户验证码注册-密码发送成功,手机号:" + mobile);
|
|
|
+ }
|
|
|
+ }
|
|
|
return ResponseJson.success(clubUserVo);
|
|
|
}
|
|
|
|
|
@@ -104,7 +119,7 @@ public class RegisterServiceImpl implements RegisterService {
|
|
|
String mobile = (String) clubUserMap.get("mobile");
|
|
|
String verifyCode = (String) clubUserMap.get("verifyCode");
|
|
|
String password = (String) clubUserMap.get("password");
|
|
|
- ResponseJson<WxClubUserVo> result = simpleRegister(mobile, verifyCode, password, authUserId, authId);
|
|
|
+ ResponseJson<WxClubUserVo> result = simpleRegister(mobile, verifyCode, password, authUserId, authId, 1);
|
|
|
int code = result.getCode();
|
|
|
if (0 != code) {
|
|
|
return result;
|