Commit 55cd8f04 authored by 季圣华's avatar 季圣华
Browse files

解决已经删除的用户依旧能登录的bug

parent e56f6d67
...@@ -229,7 +229,7 @@ public class UserService { ...@@ -229,7 +229,7 @@ public class UserService {
List<User> list = null; List<User> list = null;
try { try {
UserExample example = new UserExample(); UserExample example = new UserExample();
example.createCriteria().andLoginameEqualTo(username); example.createCriteria().andLoginameEqualTo(username).andStatusEqualTo(BusinessConstants.USER_STATUS_NORMAL);
list = userMapper.selectByExample(example); list = userMapper.selectByExample(example);
} catch (Exception e) { } catch (Exception e) {
logger.error(">>>>>>>>访问验证用户姓名是否存在后台信息异常", e); logger.error(">>>>>>>>访问验证用户姓名是否存在后台信息异常", e);
...@@ -242,7 +242,8 @@ public class UserService { ...@@ -242,7 +242,8 @@ public class UserService {
try { try {
UserExample example = new UserExample(); UserExample example = new UserExample();
example.createCriteria().andLoginameEqualTo(username).andPasswordEqualTo(password); example.createCriteria().andLoginameEqualTo(username).andPasswordEqualTo(password)
.andStatusEqualTo(BusinessConstants.USER_STATUS_NORMAL);
list = userMapper.selectByExample(example); list = userMapper.selectByExample(example);
} catch (Exception e) { } catch (Exception e) {
logger.error(">>>>>>>>>>访问验证用户密码后台信息异常", e); logger.error(">>>>>>>>>>访问验证用户密码后台信息异常", e);
...@@ -257,7 +258,7 @@ public class UserService { ...@@ -257,7 +258,7 @@ public class UserService {
public User getUserByUserName(String username)throws Exception { public User getUserByUserName(String username)throws Exception {
UserExample example = new UserExample(); UserExample example = new UserExample();
example.createCriteria().andLoginameEqualTo(username); example.createCriteria().andLoginameEqualTo(username).andStatusEqualTo(BusinessConstants.USER_STATUS_NORMAL);
List<User> list=null; List<User> list=null;
try{ try{
list= userMapper.selectByExample(example); list= userMapper.selectByExample(example);
...@@ -316,7 +317,7 @@ public class UserService { ...@@ -316,7 +317,7 @@ public class UserService {
public Long getIdByLoginName(String loginName) { public Long getIdByLoginName(String loginName) {
Long userId = 0L; Long userId = 0L;
UserExample example = new UserExample(); UserExample example = new UserExample();
example.createCriteria().andLoginameEqualTo(loginName); example.createCriteria().andLoginameEqualTo(loginName).andStatusEqualTo(BusinessConstants.USER_STATUS_NORMAL);
List<User> list = userMapper.selectByExample(example); List<User> list = userMapper.selectByExample(example);
if(list!=null) { if(list!=null) {
userId = list.get(0).getId(); userId = list.get(0).getId();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment