Commit 6a164a8f authored by m1991's avatar m1991

登录模块——登录功能修复

parent 894056c1
...@@ -240,7 +240,6 @@ ...@@ -240,7 +240,6 @@
select id as id, select id as id,
user_id as userId, user_id as userId,
password as password, password as password,
userName as userName,
user_level as userLevel, user_level as userLevel,
cross_border_line as crossBorderLine, cross_border_line as crossBorderLine,
id_card_number as idCardNumber, id_card_number as idCardNumber,
...@@ -263,9 +262,7 @@ ...@@ -263,9 +262,7 @@
<if test="salt != null and salt!=''"> <if test="salt != null and salt!=''">
and userLevel=#{userLevel} and userLevel=#{userLevel}
</if> </if>
<if test="userName != null and userName!=''">
and crossBorderLine=#{crossBorderLine}
</if>
<if test="sex != null"> <if test="sex != null">
and idCardNumber=#{idCardNumber} and idCardNumber=#{idCardNumber}
</if> </if>
......
...@@ -122,11 +122,9 @@ public class LoginController { ...@@ -122,11 +122,9 @@ public class LoginController {
map.put("code","2001"); map.put("code","2001");
map.put("msg","未登录"); map.put("msg","未登录");
return map; return map;
///throw new BaseException(ResultEnum.FILE_NOT_LOGIN);
} }
UsersDto usersDto=JSONObject.parseObject(userDtoJson,UsersDto.class); UsersDto usersDto=JSONObject.parseObject(userDtoJson,UsersDto.class);
usersDto.setPassword(null); usersDto.setPassword(null);
return (Map) ResultUtils.returnDataSuccess(userDtoJson); return (Map) ResultUtils.returnDataSuccess(userDtoJson);
} }
...@@ -169,33 +167,19 @@ public class LoginController { ...@@ -169,33 +167,19 @@ public class LoginController {
String key= StringUtil.formatKeyWithPrefix(Constants.RedisKey.PROJECT_PRIFIX,Constants.RedisKey.SMS_PRIFIX,userId,Constants.Sms.CodeType.LOGIN_OR_REGISTER+""); String key= StringUtil.formatKeyWithPrefix(Constants.RedisKey.PROJECT_PRIFIX,Constants.RedisKey.SMS_PRIFIX,userId,Constants.Sms.CodeType.LOGIN_OR_REGISTER+"");
String redisCode=redisUtils.getValue(key); String redisCode=redisUtils.getValue(key);
if(StringUtil.isBlank(redisCode) || !sms.equals(redisCode)){ if(StringUtil.isBlank(redisCode) || !sms.equals(redisCode)){
// try {
// throw new BaseException(ResultEnum.FAIL_VERIFY);
//
// } catch (BaseException e) {
Map map=new HashMap(); Map map=new HashMap();
map.put("code","1003"); map.put("code","1003");
map.put("msg","验证码错误"); map.put("msg","验证码错误");
// throw new BaseException(ResultEnum.FAIL_VERIFY);
return map; return map;
// }
} }
redisUtils.delete(key); redisUtils.delete(key);
//判断phone是否符合输入类型 //判断phone是否符合输入类型
if(!userId.matches(Constants.RegConstant.PHONE_REGSTR)){ if(!userId.matches(Constants.RegConstant.PHONE_REGSTR)){
// try {
// throw new BaseException(ResultEnum.PHONE_ERROR);
// } catch (BaseException e) {
// e.printStackTrace();
Map map=new HashMap(); Map map=new HashMap();
map.put("code","1008"); map.put("code","1008");
map.put("msg","手机号码格式不正确"); map.put("msg","手机号码格式不正确");
// throw new BaseException(ResultEnum.FAIL_VERIFY);
return map; return map;
// }
} }
return usersService.userByZx(userId,beInvitedCode); return usersService.userByZx(userId,beInvitedCode);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment