Explorar el Código

Merge branch 'master' of http://git.sagacloud.cn/IBMS/ibms-sdk

menglu hace 3 años
padre
commit
5ea79e08a8

+ 2 - 0
ibms-data-sdk/src/main/java/com/persagy/ibms/data/sdk/util/DrawUtil.java

@@ -44,7 +44,9 @@ public class DrawUtil {
 		if (sdo.containsKey("id")) {
 			JSONObject result = new JSONObject();
 			String id = (String) sdo.get("id").value_prim.value;
+			String localId = (String) sdo.get("localId").value_prim.value;
 			result.put("id", id);
+			result.put("localId", localId);
 			JSONObject obj = Repository.id2object.get(id);
 			String classCode = (String) obj.get("classCode");
 			SceneDataSet infoArray = Repository.infoArrayDic.get(classCode);

+ 9 - 2
ibms-data-sdk/src/main/java/com/persagy/ibms/data/sdk/util/HttpClientUtil.java

@@ -193,8 +193,15 @@ public class HttpClientUtil {
 		entity.setContentType("application/json");
 		HttpResponse httpResponse = client.execute(httpost);
 		String guid = httpResponse.getHeaders("guid")[0].getValue();
-		HttpEntity entity2 = httpResponse.getEntity();
-		byte[] data = EntityUtils.toByteArray(entity2);
+		InputStream is = httpResponse.getEntity().getContent();
+		ByteArrayOutputStream baos = new ByteArrayOutputStream();
+		int b = -1;
+		while ((b = is.read()) != -1) {
+			baos.write(b);
+		}
+		baos.close();
+		is.close();
+		byte[] data = baos.toByteArray();
 		BASE64Encoder encoder = new BASE64Encoder();
 		String imageBase64 = "data:image/png;base64," + encoder.encodeBuffer(data).trim();
 		imageBase64 = imageBase64.replaceAll("\n", "").replaceAll("\r", "").replaceAll(" ", "");

+ 4 - 0
ibms-data-sdk/src/main/resources/config.xml

@@ -225,6 +225,10 @@
 	<Redirect code="下发布撤防指令" http_request_type="post" url="http://39.102.43.179:9980/security/zone/order">
 		<header key="Content-Type" value="application/json"/>
 	</Redirect>
+	<!--获取base64验证码,需配置person_center的地址和端口-->
+	<Redirect code="获取验证码" http_request_type="post" url="http://39.102.40.239:9970/person-center/user/getCaptchaBase64">
+		<header key="Content-Type" value="application/json"/>
+	</Redirect>
 	<Redirect code="test-get1" http_request_type="get" url="http://39.102.43.179:9993/alarm-record/list" />
 	<Redirect code="test-post1" http_request_type="post" url="http://192.168.4.69:8806/zkt-sdk/post" />
 	<Redirect code="test-get2" http_request_type="get" url="http://39.102.43.179:9993/alarm-record/list?projectId=Pj4403070003&amp;groupCode=WD" />