forked from angelo/java-retail-app
## 添加手机号登录;
This commit is contained in:
parent
f027fbd52d
commit
aeb03e037c
|
@ -7,11 +7,7 @@ import javax.validation.constraints.Size;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 新零售登录入参
|
* 新零售登录入参
|
||||||
* @Author: jiang chao
|
|
||||||
* @Time: 2024/12/11 14:15
|
|
||||||
* @Classname: RetailMemberLogin
|
|
||||||
* @PackageName: com.hzs.retail.login.param
|
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
public class RetailLoginParam implements Serializable {
|
public class RetailLoginParam implements Serializable {
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
package com.hzs.retail.login.service.impl;
|
package com.hzs.retail.login.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.codec.Base64Decoder;
|
import cn.hutool.core.codec.Base64Decoder;
|
||||||
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
|
import com.hzs.common.core.constant.SysConstants;
|
||||||
import com.hzs.common.core.constant.msg.SystemMsgConstants;
|
import com.hzs.common.core.constant.msg.SystemMsgConstants;
|
||||||
import com.hzs.common.core.enums.EAccountStatus;
|
import com.hzs.common.core.enums.EAccountStatus;
|
||||||
import com.hzs.common.core.enums.ECategory;
|
import com.hzs.common.core.enums.ECategory;
|
||||||
|
@ -27,6 +29,7 @@ import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新零售会员登录服务
|
* 新零售会员登录服务
|
||||||
|
@ -48,27 +51,26 @@ public class RetailMemberLoginServiceImpl implements IRetailMemberLoginService {
|
||||||
throw new ServiceException("会员账号或联系方式必须填写");
|
throw new ServiceException("会员账号或联系方式必须填写");
|
||||||
}
|
}
|
||||||
|
|
||||||
CuMemberExt member = iCuMemberService.getRetailMemberByCode(userName);
|
CuMemberExt member;
|
||||||
|
|
||||||
// if (userName.startsWith(SysConstants.RETAIL_PREFIX)) {
|
if (userName.length() == 11 && userName.startsWith("1")) {
|
||||||
// // 会员编号登录
|
// 手机号 登录
|
||||||
// member = iCuMemberService.getRetailMemberByCode(userName);
|
List<CuMemberExt> memberList = iCuMemberService.listMemberByPhone(userName);
|
||||||
// } else if ((userName.length() == 11 && userName.startsWith("1"))
|
if (CollectionUtil.isEmpty(memberList)) {
|
||||||
// || Validator.isEmail(userName)) {
|
throw new ServiceException("会员账号或联系方式填写有误,请检查后重试");
|
||||||
// // 手机号 或 邮箱 登录
|
}
|
||||||
// List<CuMemberExt> memberList = iCuMemberService.listMemberByPhone(userName);
|
if (memberList.size() > 1) {
|
||||||
// if (CollectionUtil.isEmpty(memberList)) {
|
// 联系方式超过两个,只能使用会员编号进行登录
|
||||||
// throw new ServiceException("会员账号或联系方式填写有误,请检查后重试");
|
throw new ServiceException("当前会员需要使用会员编号进行登录");
|
||||||
// }
|
}
|
||||||
// if (memberList.size() > 1) {
|
member = memberList.get(0);
|
||||||
// // 联系方式超过两个,只能使用会员编号进行登录
|
} else if (userName.startsWith(SysConstants.RETAIL_PREFIX)) {
|
||||||
// throw new ServiceException("当前会员需要使用会员编号进行登录");
|
// 会员编号登录
|
||||||
// }
|
member = iCuMemberService.getRetailMemberByCode(userName);
|
||||||
// member = memberList.get(0);
|
} else {
|
||||||
// } else {
|
// 用户/密码必须填写
|
||||||
// // 用户/密码必须填写
|
throw new ServiceException("会员账号或联系方式填写有误,请检查后重试");
|
||||||
// throw new ServiceException("会员账号或联系方式填写有误,请检查后重试");
|
}
|
||||||
// }
|
|
||||||
|
|
||||||
if (null == member) {
|
if (null == member) {
|
||||||
recordLoginLog(null, EStatus.NO, userName + " 登录会员不存在");
|
recordLoginLog(null, EStatus.NO, userName + " 登录会员不存在");
|
||||||
|
|
Loading…
Reference in New Issue