From ac8a858529182cc63e563b49ca3c7b45947a86a5 Mon Sep 17 00:00:00 2001 From: shijie <648688341@qq.com> Date: Thu, 7 Jan 2021 15:58:59 +0800 Subject: [PATCH] =?UTF-8?q?=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/UserLoginServiceImpl.java | 23 ++++++++++--------- .../com/daqing/framework/util/Md5Util.java | 4 ++-- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/service/impl/UserLoginServiceImpl.java b/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/service/impl/UserLoginServiceImpl.java index 69c23249..a9fc287f 100644 --- a/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/service/impl/UserLoginServiceImpl.java +++ b/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/service/impl/UserLoginServiceImpl.java @@ -124,17 +124,6 @@ public class UserLoginServiceImpl extends ServiceImpl //删除redis里面的userEntity JwtUtils.removeUserEntityByUserId(userEntity.getId()); } - //根据userId获取roleId - List> roleList = authEmployeeRoleDao.selectMaps(new QueryWrapper().eq("user_id", userEntity.getId())); - List list = new ArrayList<>(); - for (Map map:roleList) { - list.add(map.get("role_id").toString()); - } - String roleIds = StringUtils.join(list,","); - if(userEntity != null){ - //删除redis里面的roleId - JwtUtils.removeRoleIdByUserId(userEntity.getId()); - } if(loginRequest.getType() == 1){//手机号码登录 if(userEntity == null){ @@ -153,6 +142,18 @@ public class UserLoginServiceImpl extends ServiceImpl //return ResponseResult.FAIL(CommonCode.USER_IS_NOT_EXIST.code(), CommonCode.USER_IS_NOT_EXIST.message()); } } + //根据userId获取roleId + List> roleList = authEmployeeRoleDao.selectMaps(new QueryWrapper().eq("user_id", userEntity.getId())); + List list = new ArrayList<>(); + for (Map map:roleList) { + list.add(map.get("role_id").toString()); + } + String roleIds = StringUtils.join(list,","); + if(userEntity != null){ + //删除redis里面的roleId + JwtUtils.removeRoleIdByUserId(userEntity.getId()); + } + //登录成功,token生成 long times = 86400; if(loginRequest.getTenDayEffective() == 1){ diff --git a/dq-framework-common/src/main/java/com/daqing/framework/util/Md5Util.java b/dq-framework-common/src/main/java/com/daqing/framework/util/Md5Util.java index 029e1cc0..58fad167 100644 --- a/dq-framework-common/src/main/java/com/daqing/framework/util/Md5Util.java +++ b/dq-framework-common/src/main/java/com/daqing/framework/util/Md5Util.java @@ -43,8 +43,8 @@ public class Md5Util { } catch (ParseException e) { e.printStackTrace(); } - Timestamp time = DateUtils.getDayEndTime(date); +/* Timestamp time = DateUtils.getDayEndTime(date); System.out.println(time); - System.out.println(simpleDateFormat.format(time)); + System.out.println(simpleDateFormat.format(time));*/ } }