将页面发起请求和后端发起请求路径分开(后端需要前置机出去)

This commit is contained in:
ap007 2022-09-26 10:16:45 +08:00
parent c4df94852e
commit 524879fe9b
4 changed files with 7 additions and 4 deletions

View File

@ -22,7 +22,7 @@ public class ImageOcr {
String responseResult = null;
//图像以base64编码传输方式
try {
responseResult = imagePostBybase64(PropertiesUtil.get("OcrUrl")+ocrType, fileUrl);
responseResult = imagePostBybase64(PropertiesUtil.get("ocr_url")+ocrType, fileUrl);
} catch (Exception e) {
e.printStackTrace();
}

View File

@ -44,7 +44,7 @@ public class ImageUpload extends ImageService {
}
public String doUpload(String zipPath) throws Exception {
String result = "0";
AutoScanApi autoScanApi = new AutoScanApi(PropertiesUtil.get("service_ip"),8088,PropertiesUtil.get("secret_id")+"#"+PropertiesUtil.get("secret_key"));
AutoScanApi autoScanApi = new AutoScanApi(PropertiesUtil.get("service_ip"),Integer.parseInt(PropertiesUtil.get("service_port")),PropertiesUtil.get("secret_id")+"#"+PropertiesUtil.get("secret_key"));
result = autoScanApi.ScanImageFile(appCode, zipPath);
return result;
}

View File

@ -16,6 +16,7 @@ public class ImageInfoService {
private String projectNo;
private String flowNo;
public String getFileUrl(String folderNo ,JBOTransaction tx) throws Exception {
String result = this.getResponseResult(tx);
//APZLJJ000400 APZLJJ000060
@ -58,6 +59,8 @@ public class ImageInfoService {
}
Element page = (Element) root.selectSingleNode("//PAGE[@PAGEID='"+pageId+"']");
String pageUrl = page.attributeValue("PAGE_URL");
pageUrl ="http://172.28.1.59:5051/" + pageUrl.substring(33);
System.out.println("OCRÎļþ·¾¶£º"+pageUrl);
return pageUrl;
}

View File

@ -99,7 +99,7 @@ public abstract class ImageService {
PostMethod postMethod = null;
HttpClient httpClient = null;
try {
postMethod = new PostMethod(PropertiesUtil.get("url"));
postMethod = new PostMethod(PropertiesUtil.get("server_url"));
// ÉèÖøñʽ
postMethod.getParams().setContentCharset("UTF-8");
postMethod.setParameter("data", getRequestParam());
@ -145,7 +145,7 @@ public abstract class ImageService {
}
public String getRequestUrl(){
return PropertiesUtil.get("url");
return PropertiesUtil.get("front_url");
}
public String getRequestParam() throws Exception {