diff --git a/src/main/java/com/yipin/liuwanr/mapper/UserInfoMapper.java b/src/main/java/com/yipin/liuwanr/mapper/UserInfoMapper.java index f12c490..56079c8 100644 --- a/src/main/java/com/yipin/liuwanr/mapper/UserInfoMapper.java +++ b/src/main/java/com/yipin/liuwanr/mapper/UserInfoMapper.java @@ -129,7 +129,7 @@ public interface UserInfoMapper { UserInfo logins(UserInfo userInfo); //登陆 - @Select("SELECT token,userId,userName,roleId,userAvatars from hr_user_info where isdel=0 and account = #{account} and password = #{password}") + @Select("SELECT token,userId,userName,roleId,userAvatars,password from hr_user_info where isdel=0 and account = #{account} and password = #{password}") UserInfo adminLogins(UserInfo userInfo); //登陆账号密码 diff --git a/src/main/java/com/yipin/liuwanr/service/UserInfoService.java b/src/main/java/com/yipin/liuwanr/service/UserInfoService.java index c0048a0..3f5315c 100644 --- a/src/main/java/com/yipin/liuwanr/service/UserInfoService.java +++ b/src/main/java/com/yipin/liuwanr/service/UserInfoService.java @@ -403,6 +403,7 @@ public class UserInfoService { }else if (state==0){ try { UserInfo user=userInfoMapper.loginsAP(userInfo); + //区分密码大小写 boolean num = user.getPassword().equals(userInfo.getPassword()); if(user!=null && num == true) { Integer userId = user.getUserId(); @@ -474,6 +475,9 @@ public class UserInfoService { HashMap resp = new HashMap(); try { UserInfo user=userInfoMapper.adminLogins(userInfo); + //区分密码大小写 + boolean num = user.getPassword().equals(userInfo.getPassword()); + user.setPassword(null); if(user != null){ if (user.getRoleId().contains("1")){ user.setSchoolId(null); @@ -482,7 +486,7 @@ public class UserInfoService { user.setSchoolId(schoolId); } } - if (user==null){ + if (num == false || user == null){ resp.put("retvalue","账号密码有误,请稍后再试!"); resp.put("retcode", 300); }else{