From 0cc24aac96073601f945fc23dac5cfd112bbda1a Mon Sep 17 00:00:00 2001 From: "jiakun.lin" Date: Thu, 1 Apr 2021 15:33:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=99=BB=E5=BD=95=E6=97=B6?= =?UTF-8?q?=E5=AF=86=E7=A0=81=E9=94=99=E8=AF=AF=20=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/yipin/liuwanr/service/UserInfoService.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) 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);