Browse Source

fix:优化https

master
wang 1 month ago
parent
commit
91a6782855
  1. 2
      yun-admin/src/main/resources/mapper/service/ServiceApplicationsMapper.xml
  2. 7
      yun-base/src/main/java/net/lab1024/sa/base/config/FileConfig.java
  3. 16
      yun-base/src/main/resources/prod/yun-base.yaml

2
yun-admin/src/main/resources/mapper/service/ServiceApplicationsMapper.xml

@ -477,7 +477,7 @@
</if> </if>
</where> </where>
GROUP BY tsa.user_id, tsa.certificate_number GROUP BY tsa.user_id, tsa.certificate_number
ORDER BY annualServiceDuration DESC, tsa.user_id ASC ORDER BY quarterlyServiceDuration DESC, tsa.user_id ASC
LIMIT 1 LIMIT 1
</select> </select>
<select id="getdepartmentStatistics" <select id="getdepartmentStatistics"

7
yun-base/src/main/java/net/lab1024/sa/base/config/FileConfig.java

@ -74,9 +74,12 @@ public class FileConfig implements WebMvcConfigurer {
@Bean @Bean
@ConditionalOnProperty(prefix = "file.storage", name = {"mode"}, havingValue = MODE_CLOUD) @ConditionalOnProperty(prefix = "file.storage", name = {"mode"}, havingValue = MODE_CLOUD)
public S3Client initAmazonS3() { public S3Client initAmazonS3() {
String endpointUrl = endpoint.startsWith(HTTP) || endpoint.startsWith(HTTPS)
? endpoint
: HTTP + endpoint;
return S3Client.builder() return S3Client.builder()
.region(Region.AWS_GLOBAL) .region(Region.of(region))
.endpointOverride(URI.create((urlPrefix.startsWith(HTTPS) ? HTTPS : HTTP) + endpoint)) .endpointOverride(URI.create(endpointUrl))
.credentialsProvider( .credentialsProvider(
StaticCredentialsProvider.create( StaticCredentialsProvider.create(
AwsBasicCredentials.create(accessKey, secretKey))) AwsBasicCredentials.create(accessKey, secretKey)))

16
yun-base/src/main/resources/prod/yun-base.yaml

@ -98,15 +98,21 @@ file:
storage: storage:
mode: cloud mode: cloud
local: local:
upload-path: /home/laywer/upload/ #文件上传目录 upload-path: /home/laywer/upload/
url-prefix: url-prefix:
cloud: cloud:
region: oss-cn-hangzhou region: us-east-1
endpoint: 8.148.67.92:9000
# Java SDK 通过 HTTP 连接本机 MinIO
endpoint: http://127.0.0.1:9000
bucket-name: file bucket-name: file
access-key: minioadmin access-key: minioadmin
secret-key: 12345678 secret-key: 12345678
url-prefix: http://${file.storage.cloud.endpoint}/${file.storage.cloud.bucket-name}/
# 浏览器通过 Nginx 443 反向代理访问文件
url-prefix: https://8.148.67.92/minio/file/
private-url-expire-seconds: 3600 private-url-expire-seconds: 3600
# open api配置 # open api配置
@ -182,4 +188,4 @@ smart:
# 数据库配置检测-开关 默认开启 可选(作用是固定间隔读取数据库配置更新任务,关闭后只能重启服务或通过接口修改定时任务,建议开启) # 数据库配置检测-开关 默认开启 可选(作用是固定间隔读取数据库配置更新任务,关闭后只能重启服务或通过接口修改定时任务,建议开启)
db-refresh-enabled: true db-refresh-enabled: true
# 数据库配置检测-执行间隔 默认120秒 可选 # 数据库配置检测-执行间隔 默认120秒 可选
db-refresh-interval: 60 db-refresh-interval: 60

Loading…
Cancel
Save