master
shijie 4 years ago
parent 994d506543
commit ac8a858529
  1. 23
      dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/service/impl/UserLoginServiceImpl.java
  2. 4
      dq-framework-common/src/main/java/com/daqing/framework/util/Md5Util.java

@ -124,17 +124,6 @@ public class UserLoginServiceImpl extends ServiceImpl<UserLoginDao, UserEntity>
//删除redis里面的userEntity
JwtUtils.removeUserEntityByUserId(userEntity.getId());
}
//根据userId获取roleId
List<Map<String, Object>> roleList = authEmployeeRoleDao.selectMaps(new QueryWrapper<EmployeeRoleEntity>().eq("user_id", userEntity.getId()));
List<String> 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<UserLoginDao, UserEntity>
//return ResponseResult.FAIL(CommonCode.USER_IS_NOT_EXIST.code(), CommonCode.USER_IS_NOT_EXIST.message());
}
}
//根据userId获取roleId
List<Map<String, Object>> roleList = authEmployeeRoleDao.selectMaps(new QueryWrapper<EmployeeRoleEntity>().eq("user_id", userEntity.getId()));
List<String> 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){

@ -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));*/
}
}

Loading…
Cancel
Save