Commit 5cb08284 by ypenglv

Merge remote-tracking branch 'origin/dev' into dev

2 parents 69a0a101 0256cafc
......@@ -25,7 +25,8 @@ public class SwaggerConfig {
// String basePackage = ADMIN_SWAGGER;// 要暴露的API接口的基础包名
return new Docket (DocumentationType.SWAGGER_2)
.select ()
.apis (RequestHandlerSelectors.basePackage ("org.nafmii.app"))
.apis (RequestHandlerSelectors.basePackage ("org.nafmii.app.user"))
// .apis(RequestHandlerSelectors.basePackage ("org.nafmii.app"))
.paths (PathSelectors.any ())
.build ()
.apiInfo (apiInfo ())
......
......@@ -22,11 +22,9 @@ public class LoginDto {
@ApiModelProperty("手机号/登录账号")
private String phone;
@NotNull(message = "注册密码不能为空")
@ApiModelProperty("登陆密码")
private String loginPwd;
@NotNull(message = "验证码不能为空")
@ApiModelProperty("验证码")
private String code;
......
......@@ -139,14 +139,13 @@ public class UserServiceImpl implements UserService {
if (loginDto.getType().equals("0")){
//密码登陆
userVo = appUserMapper.selectByPassword(loginDto);
if (null != userVo){
if (null == userVo){
throw new BusinessException("请先注册");
}
}else{
//验证码登陆
String code = stringRedisTemplate.opsForValue().get(USER_CODE_KEY+loginDto.getPhone());
log.info("冲redis中获取的验证码===============》{}",code);
log.info("冲缓存中获取的验证码===============》{}",code);
if (null == code){
throw new BusinessException("验证码已过期");
}
......@@ -158,10 +157,7 @@ public class UserServiceImpl implements UserService {
throw new BusinessException("请先注册");
}
}
UserJwtVO vo = new UserJwtVO();
vo.setId(userVo.getId());
vo.setPhone(userVo.getPhone());
String token = JwtUtils.generateJsonWebToken(vo);
String token = JwtUtils.createToken(loginDto.getPhone(),null);
userVo.setAuthorization(token);
ApiResponse apiResponse =new ApiResponse();
apiResponse.setData(userVo);
......
......@@ -33,10 +33,10 @@
UNIT_NAME as unitName, OPEN_ID as openId, FIGERPRINT_FALG as figerprintFalg, FACEID_FALG as faceidFalg, CREATE_TIME as createTime, UPDATE_TIME as updateTime, IS_ENABLE as isEnable
from APP_USER where IS_ENABLE = 0
<if test="phone !=null">
and PHONE !=#{phone}
and PHONE =#{phone}
</if>
<if test="loginPwd !=null">
and LOGIN_PWD !=#{loginPwd}
and LOGIN_PWD =#{loginPwd}
</if>
</select>
<select id="selectByPhone" parameterType="map" resultType="org.nafmii.app.user.vo.UserVO">
......@@ -45,7 +45,7 @@
UNIT_NAME as unitName, OPEN_ID as openId, FIGERPRINT_FALG as figerprintFalg, FACEID_FALG as faceidFalg, CREATE_TIME as createTime, UPDATE_TIME as updateTime, IS_ENABLE as isEnable
from APP_USER where IS_ENABLE = 0
<if test="phone !=null">
and PHONE !=#{phone}
and PHONE =#{phone}
</if>
</select>
</mapper>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!