| | |
| | | import com.google.gson.reflect.TypeToken; |
| | | import com.ks.tool.bkz.dto.FirstOrderSubParseResult; |
| | | import com.ks.tool.bkz.entity.FirstOrderSubInfo; |
| | | import com.ks.tool.bkz.exception.TBCookieException; |
| | | |
| | | import java.lang.reflect.Type; |
| | | import java.util.HashMap; |
| | |
| | | * @param data |
| | | * @return |
| | | */ |
| | | public static FirstOrderSubParseResult parseOrderSubData(String data) { |
| | | public static FirstOrderSubParseResult parseOrderSubData(String data) throws TBCookieException { |
| | | data = data.trim().substring(data.indexOf("(")); |
| | | if (data.endsWith(")")) |
| | | data = data.substring(0, data.length() - 1); |
| | | |
| | | //Cookie过期 |
| | | JSONObject dataJSON = JSONObject.parseObject(data); |
| | | if (dataJSON.getJSONArray("ret") != null && dataJSON.getJSONArray("ret").toString().contains("令牌")) |
| | | throw new TBCookieException(1,"cookie失效"); |
| | | |
| | | JSONObject resultValue = dataJSON.getJSONObject("data").getJSONObject("resultValue"); |
| | | |
| | | for (Iterator<String> its = resultValue.keySet().iterator(); its.hasNext(); ) { |