| | |
| | | |
| | | log.debug("--HTTP-WEIGHT-请求返回--{}", responseText); |
| | | |
| | | String respJson; |
| | | JSONObject resp; |
| | | //说明是JSONP格式-jsonpCallback({"content":""}) |
| | | if (responseText.indexOf("jsonpCallback") >= 0) { |
| | | respJson = responseText.substring(responseText.indexOf("(") + 1, responseText.length() - 1); |
| | | resp = JSONObject.parseObject(respJson); |
| | | resp.put("code", 200); |
| | | responseText = responseText.substring(responseText.indexOf("(") + 1, responseText.length() - 1); |
| | | resp = JSONObject.parseObject(responseText); |
| | | resp.put("code", "200"); |
| | | } else { |
| | | respJson = responseText; |
| | | resp = JSONObject.parseObject(respJson); |
| | | resp = JSONObject.parseObject(responseText); |
| | | } |
| | | |
| | | if (200 == (Integer) resp.get("code")) { |
| | | if ("200".equals(resp.get("code"))) { |
| | | if (null == resp.get("content") || "".equals(resp.get("content"))) { |
| | | reqData.setWeight(0.0); |
| | | } else { |
| | | reqData.setWeight((Double) resp.get("content")); |
| | | reqData.setWeight(Double.valueOf(resp.get("content")+"")); |
| | | } |
| | | } |
| | | |