//读取json文件地址
/* String path = getClass().getClassLoader().getResource("menu.json").toString();
path = path.replace("\\", "/");
if (path.contains(":")) {
path = path.replace("file:/", "");
}*/
ClassPathResource resource = new ClassPathResource("menu.json");
File filePath = resource.getFile();
JSONArray btnArray = null;
//读取文件
String input = FileUtils.readFileToString(filePath, "UTF-8");
//将读取的数据转换为JSONObject
JSONObject jsonObject = JSONObject.fromObject(input);
if (jsonObject != null) {
//取出按钮权限的数据
btnArray = jsonObject.getJSONArray("btnList");
}
Map> btnMap = new HashMap<>();
Iterator