From 99b9b82d065b8e2bdf5e9e05cb92c48af3a0f22b Mon Sep 17 00:00:00 2001 From: "jiakun.lin" Date: Wed, 24 Mar 2021 10:51:17 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=99=E5=B8=88=E7=AB=AF=E7=AB=AF=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E6=97=B6=E5=AF=86=E7=A0=81=E9=AA=8C=E8=AF=81=E5=A4=A7?= =?UTF-8?q?=E5=B0=8F=E5=86=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/yipin/liuwanr/mapper/UserInfoMapper.java | 2 +- .../java/com/yipin/liuwanr/service/UserInfoService.java | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) 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{