Browse Source

发送验证法给前台8000以上的码

master
sunyuchao 5 years ago
parent
commit
dc80c3c594
  1. 8
      epmet-auth/src/main/java/com/epmet/constant/PublicUserLoginConstant.java
  2. 6
      epmet-auth/src/main/java/com/epmet/service/impl/PublicUserLoginServiceImpl.java
  3. 5
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java

8
epmet-auth/src/main/java/com/epmet/constant/PublicUserLoginConstant.java

@ -14,14 +14,6 @@ public interface PublicUserLoginConstant {
* 是否登陆true false * 是否登陆true false
*/ */
String PARAMETER_EXCEPTION = "是否登陆值错误"; String PARAMETER_EXCEPTION = "是否登陆值错误";
/**
* 登陆验证
*/
String LOGON_EXCEPTION = "该手机号未注册";
/**
* 注册验证
*/
String ZHU_CE_EXCEPTION = "该手机号已注册";
/** /**
* 用户登陆 新增访问记录 * 用户登陆 新增访问记录
*/ */

6
epmet-auth/src/main/java/com/epmet/service/impl/PublicUserLoginServiceImpl.java

@ -157,11 +157,11 @@ public class PublicUserLoginServiceImpl implements PublicUserLoginService {
CustomerUserResultDTO ResultDTO = Result.getData(); CustomerUserResultDTO ResultDTO = Result.getData();
//登陆 //登陆
if (formDTO.getIsLogon() && null == ResultDTO.getPaUserResult()) { if (formDTO.getIsLogon() && null == ResultDTO.getPaUserResult()) {
throw new RenException(PublicUserLoginConstant.LOGON_EXCEPTION); throw new RenException(EpmetErrorCode.PUBLIC_NOT_EXISTS.getCode());
} }
//注册 //注册
if (!formDTO.getIsLogon() && null != ResultDTO.getPaUserResult()) { if (!formDTO.getIsLogon() && null != ResultDTO.getPaUserResult()) {
throw new RenException(PublicUserLoginConstant.ZHU_CE_EXCEPTION); throw new RenException(EpmetErrorCode.MOBILE_USED.getCode());
} }
//3、发送短信验证码 //3、发送短信验证码
SendVerificationCodeFormDTO sendVerificationCodeFormDTO = new SendVerificationCodeFormDTO(); SendVerificationCodeFormDTO sendVerificationCodeFormDTO = new SendVerificationCodeFormDTO();
@ -197,7 +197,7 @@ public class PublicUserLoginServiceImpl implements PublicUserLoginService {
//2.用户不存在时不允许登陆 //2.用户不存在时不允许登陆
PaUserDTO userDTO = resultDTO.getPaUserResult(); PaUserDTO userDTO = resultDTO.getPaUserResult();
if (null == userDTO || StringUtils.isBlank(userDTO.getId())) { if (null == userDTO || StringUtils.isBlank(userDTO.getId())) {
throw new RenException(PublicUserLoginConstant.LOGON_EXCEPTION); throw new RenException(EpmetErrorCode.PUBLIC_NOT_EXISTS.getCode());
} }
//3.校验验证码是否正确 //3.校验验证码是否正确

5
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java

@ -82,7 +82,10 @@ public enum EpmetErrorCode {
DRAFT_CONTENT_IS_NULL(8801, "至少需要添加一个段落"), DRAFT_CONTENT_IS_NULL(8801, "至少需要添加一个段落"),
ARTICLE_PUBLISH_ERROR(8801, "发布文章失败,请刷新重试"), ARTICLE_PUBLISH_ERROR(8801, "发布文章失败,请刷新重试"),
CUSTOMER_VALIDATE_ERROR(8999, "内部数据校验异常"); CUSTOMER_VALIDATE_ERROR(8999, "内部数据校验异常"),
//公众号 865..开头的码
PUBLIC_NOT_EXISTS(8651,"手机号未注册,请先完成信息注册"),;
private int code; private int code;

Loading…
Cancel
Save