resJsonObj = {"res":"0","msg":"","data":{"Name": "张三","Phone": "15000000003","relName": "系统管理员权限","Navigation": []}}

1.判断data是否为空

JSONObject dataJson =resJsonObj .getJSONObject("data");

if(dataJson == null || dataJson.isEmpty() || dataJson.isNullObject() || "null".equals(dataJson)){
               return "error";
}

2.判断Nacigation数组是否为空

JSONArray dataNJson = dataJson.getJSONArray("Navigation");
if(dataNJson.isEmpty()||dataNJson.size()<1){
  return "error";
}

 

原创博客,引用请注明出处    https://www.cnblogs.com/guangxiang/p/10334130.html

相关文章:

  • 2021-12-22
  • 2023-02-20
  • 2022-12-23
  • 2021-11-05
  • 2022-01-22
  • 2022-02-23
  • 2022-12-23
  • 2021-11-28
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-21
  • 2022-01-06
相关资源
相似解决方案