From 329a75bbc15e04e49d4c209f2834a015246dbf84 Mon Sep 17 00:00:00 2001 From: macro Date: Tue, 22 Oct 2019 21:07:18 +0800 Subject: [PATCH] =?UTF-8?q?dev=20=E7=8E=AF=E5=A2=83https=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mall-common/pom.xml | 2 +- .../mall/portal/config/TomcatConfig.java | 2 +- .../src/main/resources/application-dev.yml | 7 +-- .../src/main/resources/application-https.yml | 52 +++++++++++++++++++ 4 files changed, 55 insertions(+), 8 deletions(-) create mode 100644 mall-portal/src/main/resources/application-https.yml diff --git a/mall-common/pom.xml b/mall-common/pom.xml index f2ddf02..2a6f37a 100644 --- a/mall-common/pom.xml +++ b/mall-common/pom.xml @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - + com.macro.mall mall-common 1.0-SNAPSHOT diff --git a/mall-portal/src/main/java/com/macro/mall/portal/config/TomcatConfig.java b/mall-portal/src/main/java/com/macro/mall/portal/config/TomcatConfig.java index 2c2d518..b462be0 100644 --- a/mall-portal/src/main/java/com/macro/mall/portal/config/TomcatConfig.java +++ b/mall-portal/src/main/java/com/macro/mall/portal/config/TomcatConfig.java @@ -11,7 +11,7 @@ import org.springframework.context.annotation.Profile; * tomcat相关配置 * Created by macro on 2018/8/7. */ -@Profile("dev") +@Profile("https") @Configuration public class TomcatConfig { @Value("${http.port}") diff --git a/mall-portal/src/main/resources/application-dev.yml b/mall-portal/src/main/resources/application-dev.yml index f4e6d3d..40909e2 100644 --- a/mall-portal/src/main/resources/application-dev.yml +++ b/mall-portal/src/main/resources/application-dev.yml @@ -1,10 +1,5 @@ server: - port: 8443 #开发环境会开启https - ssl: - key-store: keystore.p12 - key-alias: tomcat - key-store-password: 123456 - key-store-type: PKCS12 + port: 8085 spring: datasource: diff --git a/mall-portal/src/main/resources/application-https.yml b/mall-portal/src/main/resources/application-https.yml new file mode 100644 index 0000000..f4670f8 --- /dev/null +++ b/mall-portal/src/main/resources/application-https.yml @@ -0,0 +1,52 @@ +server: + port: 8443 #https环境会开启https + ssl: + key-store: keystore.p12 + key-alias: tomcat + key-store-password: 123456 + key-store-type: PKCS12 +spring: + datasource: + url: jdbc:mysql://localhost:3306/mall?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai + username: root + password: root + druid: + initial-size: 5 #连接池初始化大小 + min-idle: 10 #最小空闲连接数 + max-active: 20 #最大连接数 + web-stat-filter: + exclusions: "*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*" #不统计这些请求数据 + stat-view-servlet: #访问监控网页的登录用户名和密码 + login-username: druid + login-password: druid + data: + mongodb: + host: localhost + port: 27017 + database: mall-port + redis: + host: localhost # Redis服务器地址 + database: 0 # Redis数据库索引(默认为0) + port: 6379 # Redis服务器连接端口 + password: # Redis服务器连接密码(默认为空) + jedis: + pool: + max-active: 8 # 连接池最大连接数(使用负值表示没有限制) + max-wait: -1ms # 连接池最大阻塞等待时间(使用负值表示没有限制) + max-idle: 8 # 连接池中的最大空闲连接 + min-idle: 0 # 连接池中的最小空闲连接 + timeout: 3000ms # 连接超时时间(毫秒) + rabbitmq: + host: localhost + port: 5672 + virtual-host: /mall + username: mall + password: mall + publisher-confirms: true #如果对异步消息需要回调必须设置为true +# 日志配置 +logging: + level: + org.springframework.data.mongodb.core: debug + com.macro.mall.mapper: debug + com.macro.mall.portal.dao: debug +