|
|
|
@ -1,16 +1,13 @@ |
|
|
|
package com.epmet.controller; |
|
|
|
|
|
|
|
import com.epmet.commons.tools.security.dto.GovTokenDto; |
|
|
|
import com.epmet.commons.tools.utils.Result; |
|
|
|
import com.epmet.commons.tools.validator.ValidatorUtils; |
|
|
|
import com.epmet.dto.form.*; |
|
|
|
import com.epmet.dto.result.LoginUserInfoResultDTO; |
|
|
|
import com.epmet.dto.result.RoleOpeScopeResultDTO; |
|
|
|
import com.epmet.service.AccessService; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
|
|
|
|
import javax.validation.constraints.NotBlank; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Set; |
|
|
|
|
|
|
|
@ -46,26 +43,26 @@ public class AccessController { |
|
|
|
return new Result(); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 从缓存中查询用户信息(DataFilterAspect中用到) |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
@PostMapping("loginuserinfo") |
|
|
|
public Result<LoginUserInfoResultDTO> getLoginUserInfo(@RequestBody StaffPermCacheFormDTO dto) { |
|
|
|
ValidatorUtils.validateEntity(dto, StaffPermCacheFormDTO.GetStaffCurrPermissions.class); |
|
|
|
GovTokenDto govTokenDto = accessService.getUserDetails(dto.getApp(), dto.getClient(), dto.getStaffId()); |
|
|
|
LoginUserInfoResultDTO resultDTO = null; |
|
|
|
if (govTokenDto != null) { |
|
|
|
resultDTO = new LoginUserInfoResultDTO(); |
|
|
|
resultDTO.setRoleIdList(govTokenDto.getRoleIdList()); |
|
|
|
//resultDTO.setGridId(govTokenDto.getGridId());
|
|
|
|
resultDTO.setOrgIdPath(govTokenDto.getOrgIdPath()); |
|
|
|
resultDTO.setGridIdList(govTokenDto.getGridIdList()); |
|
|
|
resultDTO.setDeptIdList(govTokenDto.getDeptIdList()); |
|
|
|
resultDTO.setUserId(govTokenDto.getUserId()); |
|
|
|
} |
|
|
|
return new Result<LoginUserInfoResultDTO>().ok(resultDTO); |
|
|
|
} |
|
|
|
///**
|
|
|
|
// * 从缓存中查询用户信息(DataFilterAspect中用到)
|
|
|
|
// * @return
|
|
|
|
// */
|
|
|
|
//@PostMapping("loginuserinfo")
|
|
|
|
//public Result<LoginUserInfoResultDTO> getLoginUserInfo(@RequestBody StaffPermCacheFormDTO dto) {
|
|
|
|
// ValidatorUtils.validateEntity(dto, StaffPermCacheFormDTO.GetStaffCurrPermissions.class);
|
|
|
|
// GovTokenDto govTokenDto = accessService.getUserDetails(dto.getApp(), dto.getClient(), dto.getStaffId());
|
|
|
|
// LoginUserInfoResultDTO resultDTO = null;
|
|
|
|
// if (govTokenDto != null) {
|
|
|
|
// resultDTO = new LoginUserInfoResultDTO();
|
|
|
|
// resultDTO.setRoleIdList(govTokenDto.getRoleIdList());
|
|
|
|
// //resultDTO.setGridId(govTokenDto.getGridId());
|
|
|
|
// resultDTO.setOrgIdPath(govTokenDto.getOrgIdPath());
|
|
|
|
// resultDTO.setGridIdList(govTokenDto.getGridIdList());
|
|
|
|
// resultDTO.setDeptIdList(govTokenDto.getDeptIdList());
|
|
|
|
// resultDTO.setUserId(govTokenDto.getUserId());
|
|
|
|
// }
|
|
|
|
// return new Result<LoginUserInfoResultDTO>().ok(resultDTO);
|
|
|
|
//}
|
|
|
|
|
|
|
|
/** |
|
|
|
* 查询角色的操作key对应操作范围列表(缓存) |
|
|
|
|