|
|
@ -6,6 +6,7 @@ import com.shxy.xymanager_common.config.CustomRsaProperties;
|
|
|
|
import com.shxy.xymanager_common.constant.HttpStatusCode;
|
|
|
|
import com.shxy.xymanager_common.constant.HttpStatusCode;
|
|
|
|
import com.shxy.xymanager_common.entity.SysUser;
|
|
|
|
import com.shxy.xymanager_common.entity.SysUser;
|
|
|
|
import com.shxy.xymanager_common.dto.TerminalsAndStatusDto;
|
|
|
|
import com.shxy.xymanager_common.dto.TerminalsAndStatusDto;
|
|
|
|
|
|
|
|
import com.shxy.xymanager_common.entity.TbResource;
|
|
|
|
import com.shxy.xymanager_common.enums.CommonStatus;
|
|
|
|
import com.shxy.xymanager_common.enums.CommonStatus;
|
|
|
|
import com.shxy.xymanager_common.exception.ApiException;
|
|
|
|
import com.shxy.xymanager_common.exception.ApiException;
|
|
|
|
import com.shxy.xymanager_common.exception.Asserts;
|
|
|
|
import com.shxy.xymanager_common.exception.Asserts;
|
|
|
@ -15,6 +16,7 @@ import com.shxy.xymanager_common.util.StringUtils;
|
|
|
|
import com.shxy.xymanager_common.util.TokenUtil;
|
|
|
|
import com.shxy.xymanager_common.util.TokenUtil;
|
|
|
|
import com.shxy.xymanager_dao.dao.*;
|
|
|
|
import com.shxy.xymanager_dao.dao.*;
|
|
|
|
import com.shxy.xymanager_service.service.PermissionService;
|
|
|
|
import com.shxy.xymanager_service.service.PermissionService;
|
|
|
|
|
|
|
|
import com.shxy.xymanager_service.service.RolePermissionService;
|
|
|
|
import com.shxy.xymanager_service.service.SysUserService;
|
|
|
|
import com.shxy.xymanager_service.service.SysUserService;
|
|
|
|
import com.shxy.xymanager_service.service.UserService;
|
|
|
|
import com.shxy.xymanager_service.service.UserService;
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
@ -35,6 +37,8 @@ public class UserServiceImpl implements UserService {
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
@Resource
|
|
|
|
PermissionService permissionService;
|
|
|
|
PermissionService permissionService;
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
|
|
|
RolePermissionService rolePermissionService;
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
|
TerminalsDao terminalsDao;
|
|
|
|
TerminalsDao terminalsDao;
|
|
|
@ -59,6 +63,12 @@ public class UserServiceImpl implements UserService {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
String token = tokenUtil.generateToken(user.getUid());
|
|
|
|
String token = tokenUtil.generateToken(user.getUid());
|
|
|
|
user.setToken(token);
|
|
|
|
user.setToken(token);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (SUPER_ADMIN != user.getRole()) {
|
|
|
|
|
|
|
|
// 获取菜单资源
|
|
|
|
|
|
|
|
List<TbResource> resourceList = rolePermissionService.getPermitResource(user.getRole());
|
|
|
|
|
|
|
|
user.setResources(resourceList);
|
|
|
|
|
|
|
|
}
|
|
|
|
return user;
|
|
|
|
return user;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|