教师端端登录时密码验证大小写

master
jiakun.lin 4 years ago
parent cc45c3bece
commit 99b9b82d06
  1. 2
      src/main/java/com/yipin/liuwanr/mapper/UserInfoMapper.java
  2. 6
      src/main/java/com/yipin/liuwanr/service/UserInfoService.java

@ -129,7 +129,7 @@ public interface UserInfoMapper {
UserInfo logins(UserInfo userInfo); 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); UserInfo adminLogins(UserInfo userInfo);
//登陆账号密码 //登陆账号密码

@ -403,6 +403,7 @@ public class UserInfoService {
}else if (state==0){ }else if (state==0){
try { try {
UserInfo user=userInfoMapper.loginsAP(userInfo); UserInfo user=userInfoMapper.loginsAP(userInfo);
//区分密码大小写
boolean num = user.getPassword().equals(userInfo.getPassword()); boolean num = user.getPassword().equals(userInfo.getPassword());
if(user!=null && num == true) { if(user!=null && num == true) {
Integer userId = user.getUserId(); Integer userId = user.getUserId();
@ -474,6 +475,9 @@ public class UserInfoService {
HashMap<String, Object> resp = new HashMap<String, Object>(); HashMap<String, Object> resp = new HashMap<String, Object>();
try { try {
UserInfo user=userInfoMapper.adminLogins(userInfo); UserInfo user=userInfoMapper.adminLogins(userInfo);
//区分密码大小写
boolean num = user.getPassword().equals(userInfo.getPassword());
user.setPassword(null);
if(user != null){ if(user != null){
if (user.getRoleId().contains("1")){ if (user.getRoleId().contains("1")){
user.setSchoolId(null); user.setSchoolId(null);
@ -482,7 +486,7 @@ public class UserInfoService {
user.setSchoolId(schoolId); user.setSchoolId(schoolId);
} }
} }
if (user==null){ if (num == false || user == null){
resp.put("retvalue","账号密码有误,请稍后再试!"); resp.put("retvalue","账号密码有误,请稍后再试!");
resp.put("retcode", 300); resp.put("retcode", 300);
}else{ }else{

Loading…
Cancel
Save