|  | @ -72,6 +72,51 @@ public class EsbHttp {
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     /**
 | 
	
		
			
				|  |  |      * 获取app secret
 | 
	
		
			
				|  |  |      * @return
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  |     public static String getSecret() {
 | 
	
		
			
				|  |  |         try {
 | 
	
		
			
				|  |  |             String loginAction = EHRHttpHelper.defaultHttpUrl + "/apps/" + EHRHttpHelper.clientId;
 | 
	
		
			
				|  |  |             Map<String, String> header = new HashMap<>();
 | 
	
		
			
				|  |  |             header.put("Authorization", "Basic " + EHRHttpHelper.clientKey);
 | 
	
		
			
				|  |  |             //本地指纹
 | 
	
		
			
				|  |  |             Map<String, String> params = new HashMap<>();
 | 
	
		
			
				|  |  |             params.put("info", "{\"fingerprint\": \"" + GetFingerprint() + "\"}");
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |             HTTPResponse response = EHRHttpHelper.put(loginAction, params, header);
 | 
	
		
			
				|  |  |             if (response != null && response.getStatusCode() == HttpStatus.SC_OK) {
 | 
	
		
			
				|  |  |                 JSONObject obj = new JSONObject(response.getBody());
 | 
	
		
			
				|  |  |                 //判断是否成功
 | 
	
		
			
				|  |  |                 if (Boolean.parseBoolean(obj.get("successFlg").toString())){
 | 
	
		
			
				|  |  |                     JSONObject app = obj.getJSONObject("obj");
 | 
	
		
			
				|  |  |                     if (app.has("secret")) {
 | 
	
		
			
				|  |  |                         return app.getString("secret");
 | 
	
		
			
				|  |  |                     } else {
 | 
	
		
			
				|  |  |                         logger.info("返回未包含secret。");
 | 
	
		
			
				|  |  |                         return null;
 | 
	
		
			
				|  |  |                     }
 | 
	
		
			
				|  |  |                 }else {
 | 
	
		
			
				|  |  |                     logger.info("获取secret 请求失败。");
 | 
	
		
			
				|  |  |                     return null;
 | 
	
		
			
				|  |  |                 }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |             } else {
 | 
	
		
			
				|  |  |                 String msg = "获取secret失败。";
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |                 if (response != null) {
 | 
	
		
			
				|  |  |                     msg += "(错误代码:" + response.getStatusCode() + ",错误信息:" + response.getBody() + ")";
 | 
	
		
			
				|  |  |                 }
 | 
	
		
			
				|  |  |                 logger.info(msg);
 | 
	
		
			
				|  |  |                 return null;
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |         } catch (Exception ex) {
 | 
	
		
			
				|  |  |             logger.info("获取Token失败," + ex.getMessage());
 | 
	
		
			
				|  |  |             return null;
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     /**
 | 
	
		
			
				|  |  |      * 应用登录验证
 | 
	
		
			
				|  |  |      */
 |