diff --git a/src/main/java/com/yipin/liuwanr/service/UserInfoService.java b/src/main/java/com/yipin/liuwanr/service/UserInfoService.java index fc257ac..5752d54 100644 --- a/src/main/java/com/yipin/liuwanr/service/UserInfoService.java +++ b/src/main/java/com/yipin/liuwanr/service/UserInfoService.java @@ -404,7 +404,11 @@ public class UserInfoService { try { UserInfo user=userInfoMapper.loginsAP(userInfo); //区分密码大小写 - boolean num = user.getPassword().equals(userInfo.getPassword()); + boolean num = false; + if (user != null){ + num = userInfo.getPassword().equals(user.getPassword()); + } + if(user!=null && num == true) { Integer userId = user.getUserId(); @@ -476,8 +480,11 @@ public class UserInfoService { try { UserInfo user=userInfoMapper.adminLogins(userInfo); //区分密码大小写 - boolean num = user.getPassword().equals(userInfo.getPassword()); - user.setPassword(null); + boolean num = false; + if (user != null){ + num = userInfo.getPassword().equals(user.getPassword()); + user.setPassword(null); + } if(user != null){ if (user.getRoleId().contains("1")){ user.setSchoolId(null);