| | |
| | | import com.moral.api.entity.ManageRole; |
| | | import com.moral.api.pojo.dto.login.AccountInfoDTO; |
| | | import lombok.Data; |
| | | import org.springframework.util.ObjectUtils; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | |
| | | List<ManageRole> roles = dto.getRoles(); |
| | | //封装roleNames |
| | | ArrayList<String> roleNames = new ArrayList<>(); |
| | | if (!ObjectUtils.isEmpty(roles)) { |
| | | roles.forEach(role->roleNames.add(role.getName())); |
| | | } |
| | | /*过滤menu无用属性*/ |
| | | if (!ObjectUtils.isEmpty(menus)) { |
| | | for (ManageMenu menu : menus) { |
| | | menu.setCreateTime(null); |
| | | menu.setIsDelete(null); |
| | |
| | | child.setParentId(null); |
| | | } |
| | | } |
| | | } |
| | | vo.setAccountId(account.getId()); |
| | | vo.setUserName(account.getUserName()); |
| | | vo.setMenus(menus); |