...
|
...
|
@@ -17,6 +17,7 @@ import org.springframework.http.ResponseEntity; |
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.web.client.RestTemplate;
|
|
|
import javax.annotation.Resource;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.LinkedHashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
...
|
...
|
@@ -121,7 +122,7 @@ public class LoginService { |
|
|
|
|
|
logger.info("call 【 {} 】. formEntity={}, result={}", url, formEntity, responseResponseEntity);
|
|
|
Map<String, Object> body = (Map<String, Object>) responseResponseEntity.getBody();
|
|
|
Map<String, Object> data = (Map<String, Object>) body.get("data");
|
|
|
List<LinkedHashMap> data = (List<LinkedHashMap>) body.get("data");
|
|
|
|
|
|
if (!"200".equals(body.get("code"))) {
|
|
|
logger.warn("getUserMenu error. with pid={}, roleId={}, resp={}", pid, roleId, responseResponseEntity);
|
...
|
...
|
@@ -133,7 +134,17 @@ public class LoginService { |
|
|
return new Response<>(map);
|
|
|
}
|
|
|
|
|
|
private void converList(Map<String, Object> data, Map<String, List<MenuInfoResponseBO>> map) {
|
|
|
private void converList(List<LinkedHashMap> data, Map<String, List<MenuInfoResponseBO>> map) {
|
|
|
List<MenuInfoResponseBO> menuList;
|
|
|
for (LinkedHashMap item : data) {
|
|
|
menuList = new ArrayList<>();
|
|
|
|
|
|
List<LinkedHashMap> sub = (List<LinkedHashMap>) item.get("sub");
|
|
|
|
|
|
for (LinkedHashMap subItem : sub) {
|
|
|
menuList.add(new MenuInfoResponseBO((String)subItem.get("menu_url"), (String)subItem.get("menu_name")));
|
|
|
}
|
|
|
map.put((String)item.get("menu_name"), menuList);
|
|
|
}
|
|
|
}
|
|
|
} |
...
|
...
|
|