提交 883e9f3c authored 作者: LJJ's avatar LJJ

修改请求为https

上级 187f4de5
package com.zjty.efs.union; package com.zjty.efs.union;
import org.apache.catalina.connector.Connector;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
import org.springframework.boot.web.servlet.server.ServletWebServerFactory;
import org.springframework.context.annotation.Bean;
import springfox.documentation.swagger2.annotations.EnableSwagger2; import springfox.documentation.swagger2.annotations.EnableSwagger2;
/** /**
...@@ -21,6 +25,24 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2; ...@@ -21,6 +25,24 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2;
@EnableSwagger2 @EnableSwagger2
public class UnionApplication { public class UnionApplication {
public static void main(String[] args) { public static void main(String[] args) {
SpringApplication.run(UnionApplication.class, args); SpringApplication.run(UnionApplication.class, args);
} }
@Bean
public ServletWebServerFactory servletContainer() {
TomcatServletWebServerFactory tomcat = new TomcatServletWebServerFactory();
tomcat.addAdditionalTomcatConnectors(createHTTPConnector());
return tomcat;
}
private Connector createHTTPConnector() {
Connector connector = new Connector("org.apache.coyote.http11.Http11NioProtocol");
//同时启用http(8080)、https(8443)两个端口
connector.setScheme("http");
connector.setSecure(false);
connector.setPort(8084);
connector.setRedirectPort(8082);
return connector;
}
} }
...@@ -23,3 +23,11 @@ spring.servlet.multipart.max-file-size=100MB ...@@ -23,3 +23,11 @@ spring.servlet.multipart.max-file-size=100MB
spring.servlet.multipart.max-request-size=100MB spring.servlet.multipart.max-request-size=100MB
file.address=/Users/ljj/software/ftp file.address=/Users/ljj/software/ftp
server.ssl.key-store=classpath:3725333_filetransfer.products.zjtys.com.cn.pfx
# 证书密码,请修改为您自己证书的密码.
server.ssl.key-store-password=lR4072XF
# 秘钥库类型
server.ssl.keyStoreType=PKCS12
# 证书别名
server.ssl.keyAlias= alias
\ No newline at end of file
...@@ -214,9 +214,7 @@ public class UserServiceImpl implements UserService { ...@@ -214,9 +214,7 @@ public class UserServiceImpl implements UserService {
} }
}); });
map.remove("admin"); map.remove("admin");
map.forEach((k,v) -> { map.forEach((k,v) -> rs.add(new DepUser(k,v)));
rs.add(new DepUser(k,v));
});
return rs; return rs;
} }
} }
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论