Commit c27678f6 by zhoujinghao

登陆接口两种方式提交

1 parent 869f2152
......@@ -149,6 +149,10 @@ public class UserServiceImpl implements UserService {
if (loginDto.getType().equals(UserEnum.LOGINPWD.getCode())){
//密码登陆
userVo = appUserMapper.selectByPassword(loginDto);
if (null == userVo){
return new ApiResponse(ApiResponse.FAIL, MessageEnum.FAIR_PASSWORD.getRemarks());
}
userVo.setLoginType(UserEnum.NOTFIRSTLOGIN.getCode());
}else{
//验证码登陆
String code = stringRedisTemplate.opsForValue().get(USER_CODE_KEY+loginDto.getPhone());
......@@ -157,6 +161,8 @@ public class UserServiceImpl implements UserService {
return new ApiResponse(ApiResponse.FAIL, MessageEnum.CODE_ERROR.getRemarks());
}
userVo = appUserMapper.selectByPhone(loginDto.getPhone());
log.info("验证码登录返回用户实体=======》{}",userVo);
userVo.setLoginType(userVo!=null ? UserEnum.NOTFIRSTLOGIN.getCode() :UserEnum.FIRSTLOGIN.getCode());
}
Map<String,Object> map = new HashMap<>();
map.put(HttpClientHeaderEnum.USER_HEADER_USER_ID.getCode(),userVo.getId());
......
......@@ -64,6 +64,10 @@ public class UserVO {
@ApiModelProperty(value = "是否有效标识 0 有效用户 1无效用户")
private String isEnable;
@ApiModelProperty(value = "token")
private String authorization;
@ApiModelProperty(value = "验证码登陆判断是否第一次登陆 0是 1否")
private String loginType;
}
......@@ -22,6 +22,7 @@ public enum MessageEnum {
FILE_PICTURE(-113L, "图片格式非法!"),
CODE_ERROR(-114L, "验证码错误或失效!"),
EXCEL_ERROR(-115L, "导入模板列数不匹配!"),
FAIR_PASSWORD(-116L, "密码有误!"),
;
private Long code;
......
......@@ -25,9 +25,16 @@ public enum UserEnum{
*/
ENABLE("0","有效用户"),
NOTENABLE("1","无效用户"),
/**
* 登陆方式
*/
LOGINPHONE("1","验证码"),
LOGINPWD("0","密码"),
/**
*用户是否第一次登陆
*/
FIRSTLOGIN("0","是第一次登陆"),
NOTFIRSTLOGIN("1","不是第一次登陆"),
;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!