diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a44507..36d14d5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,4 +7,7 @@ 3. 优化过期文档删除功能 ### 1.0.7 -1. 重构上传规则,一次性上传所有信息 \ No newline at end of file +1. 重构上传规则,一次性上传所有信息 + +### 1.0.9 +1. 增加https协议上传 \ No newline at end of file diff --git a/document-server/pom.xml b/document-server/pom.xml index 619afdf..67ea2b9 100644 --- a/document-server/pom.xml +++ b/document-server/pom.xml @@ -5,7 +5,7 @@ maven-document-upload-parent cn.yunmaozj.tools - 1.0.8 + 1.0.9 4.0.0 diff --git a/document-server/src/main/java/cn/yunmaozj/controller/IndexController.java b/document-server/src/main/java/cn/yunmaozj/controller/IndexController.java index 5695189..8b9ca90 100644 --- a/document-server/src/main/java/cn/yunmaozj/controller/IndexController.java +++ b/document-server/src/main/java/cn/yunmaozj/controller/IndexController.java @@ -37,6 +37,23 @@ public class IndexController { @Autowired private Project project; + private final String openWindowJS = new StringBuilder().append("").toString(); + + private final String headHtml = new StringBuilder().append("") + .append("") + .append("") + .append("Document") + .append("") + .append("").toString(); + @RequestMapping(value = {"index.html", "/"}) public void index(HttpServletResponse response) throws IOException { UserDetails userDetails = (UserDetails) SecurityContextHolder.getContext().getAuthentication().getPrincipal(); @@ -46,12 +63,7 @@ public class IndexController { StringBuilder html = new StringBuilder(); html.append(""); html.append(""); - html.append(""); - html.append(""); - html.append(""); - html.append("Document"); - html.append(""); - html.append(""); + html.append(headHtml); html.append(""); html.append(""); html.append(""); @@ -95,21 +107,10 @@ public class IndexController { html.append("
"); html.append(""); html.append(""); - html.append(""); + html.append(openWindowJS); html.append(""); response.setContentType("text/html;charset=UTF-8"); response.getOutputStream().write(html.toString().getBytes("UTF-8")); - // return html.toString(); } @ResponseBody diff --git a/document-upload-maven-plugin/pom.xml b/document-upload-maven-plugin/pom.xml index 951cfdb..3f304b7 100644 --- a/document-upload-maven-plugin/pom.xml +++ b/document-upload-maven-plugin/pom.xml @@ -5,7 +5,7 @@ maven-document-upload-parent cn.yunmaozj.tools - 1.0.8 + 1.0.9 4.0.0 diff --git a/document-upload-maven-plugin/src/main/java/cn/yunmaozj/upload/DocumentUploadMojo.java b/document-upload-maven-plugin/src/main/java/cn/yunmaozj/upload/DocumentUploadMojo.java index ffa43f4..ed6223b 100644 --- a/document-upload-maven-plugin/src/main/java/cn/yunmaozj/upload/DocumentUploadMojo.java +++ b/document-upload-maven-plugin/src/main/java/cn/yunmaozj/upload/DocumentUploadMojo.java @@ -116,7 +116,7 @@ public class DocumentUploadMojo extends AbstractMojo { .build(); HttpUrl.Builder httpUrlBuilder = new HttpUrl.Builder(); - if (ssl) { + if (ssl || siteServerPort == 443) { httpUrlBuilder.scheme("https"); } else { httpUrlBuilder.scheme("http"); @@ -128,9 +128,11 @@ public class DocumentUploadMojo extends AbstractMojo { httpUrlBuilder.addPathSegment("site-upload"); Request request = new Request.Builder().url(httpUrlBuilder.build()) .post(body).build(); + long timeStart = System.currentTimeMillis(); Response response = getClient().newCall(request).execute(); getLog().info("Uploading file:[" + outFile + "] to [" + request.url() + "]"); getLog().info(response.toString()); + getLog().info("execute time:"+((System.currentTimeMillis() - timeStart) / 1000f)); if (!response.isSuccessful()) getLog().info("Response Body[" + response.body().string() + "]"); } diff --git a/pom.xml b/pom.xml index 9116c0a..07110ec 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ cn.yunmaozj.tools maven-document-upload-parent - 1.0.8 + 1.0.9 站点上传插件