|
@@ -17,6 +17,7 @@ import org.springframework.http.ResponseEntity; |
|
@@ -17,6 +17,7 @@ import org.springframework.http.ResponseEntity; |
17
|
import org.springframework.stereotype.Service;
|
17
|
import org.springframework.stereotype.Service;
|
18
|
import org.springframework.web.client.RestTemplate;
|
18
|
import org.springframework.web.client.RestTemplate;
|
19
|
import javax.annotation.Resource;
|
19
|
import javax.annotation.Resource;
|
|
|
20
|
+import java.util.ArrayList;
|
20
|
import java.util.LinkedHashMap;
|
21
|
import java.util.LinkedHashMap;
|
21
|
import java.util.List;
|
22
|
import java.util.List;
|
22
|
import java.util.Map;
|
23
|
import java.util.Map;
|
|
@@ -121,7 +122,7 @@ public class LoginService { |
|
@@ -121,7 +122,7 @@ public class LoginService { |
121
|
|
122
|
|
122
|
logger.info("call 【 {} 】. formEntity={}, result={}", url, formEntity, responseResponseEntity);
|
123
|
logger.info("call 【 {} 】. formEntity={}, result={}", url, formEntity, responseResponseEntity);
|
123
|
Map<String, Object> body = (Map<String, Object>) responseResponseEntity.getBody();
|
124
|
Map<String, Object> body = (Map<String, Object>) responseResponseEntity.getBody();
|
124
|
- Map<String, Object> data = (Map<String, Object>) body.get("data");
|
125
|
+ List<LinkedHashMap> data = (List<LinkedHashMap>) body.get("data");
|
125
|
|
126
|
|
126
|
if (!"200".equals(body.get("code"))) {
|
127
|
if (!"200".equals(body.get("code"))) {
|
127
|
logger.warn("getUserMenu error. with pid={}, roleId={}, resp={}", pid, roleId, responseResponseEntity);
|
128
|
logger.warn("getUserMenu error. with pid={}, roleId={}, resp={}", pid, roleId, responseResponseEntity);
|
|
@@ -133,7 +134,17 @@ public class LoginService { |
|
@@ -133,7 +134,17 @@ public class LoginService { |
133
|
return new Response<>(map);
|
134
|
return new Response<>(map);
|
134
|
}
|
135
|
}
|
135
|
|
136
|
|
136
|
- private void converList(Map<String, Object> data, Map<String, List<MenuInfoResponseBO>> map) {
|
137
|
+ private void converList(List<LinkedHashMap> data, Map<String, List<MenuInfoResponseBO>> map) {
|
|
|
138
|
+ List<MenuInfoResponseBO> menuList;
|
|
|
139
|
+ for (LinkedHashMap item : data) {
|
|
|
140
|
+ menuList = new ArrayList<>();
|
|
|
141
|
+
|
|
|
142
|
+ List<LinkedHashMap> sub = (List<LinkedHashMap>) item.get("sub");
|
137
|
|
143
|
|
|
|
144
|
+ for (LinkedHashMap subItem : sub) {
|
|
|
145
|
+ menuList.add(new MenuInfoResponseBO((String)subItem.get("menu_url"), (String)subItem.get("menu_name")));
|
|
|
146
|
+ }
|
|
|
147
|
+ map.put((String)item.get("menu_name"), menuList);
|
|
|
148
|
+ }
|
138
|
}
|
149
|
}
|
139
|
} |
150
|
} |