Compare commits

..

No commits in common. "a71efab4177a9a296649b281cc252041fdb9212e" and "a18c45165e20b409b2a96105ab96f68da37a2bcd" have entirely different histories.

5 changed files with 6 additions and 28 deletions

View File

@ -1,11 +1,11 @@
# Spring
spring:
spring:
application:
# 应用名称
name: bonus-auth
profiles:
# 环境配置
active: jyy_canteen_test
active: jyy_canteen_local
#加密组件
jasypt:

View File

@ -5,7 +5,7 @@ spring:
name: bonus-gateway
profiles:
# 环境配置
active: jyy_canteen_test
active: jyy_canteen_local
#加密组件
jasypt:

View File

@ -37,11 +37,6 @@ public class MinioConfig
* 存储桶名称
*/
private String bucketName;
/**
*
* 内网IP地址
*/
private String endpointInter;
@Bean
public MinioClient getMinioClient()

View File

@ -18,7 +18,6 @@ import javax.annotation.Resource;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.net.InetAddress;
import java.util.*;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutorService;
@ -304,25 +303,9 @@ public class MinioUtil {
if (StringUtils.isNotEmpty(fileUrl)){
if (fileUrl.startsWith("http://")) {
return fileUrl;
}
// 获取当前访问系统的 IP通过配置或工具方法获取
String currentIp = InetAddress.getLocalHost().getHostAddress();
// 判断访问来源是内网还是外网
boolean isIntranet = currentIp.startsWith("10.");
// 根据来源返回不同的访问地址
String endpoint;
if (isIntranet) {
// 内网访问比如你给的 10.145.136.229
endpoint = minioConfig.getEndpointInter();
} else {
// 外网或局域网访问比如你给的 192.168.20.234
endpoint = minioConfig.getEndpoint();
return minioConfig.getEndpoint() + "/" + minioConfig.getBucketName() + "/" + fileUrl;
}
// 拼接完整路径MinIO 地址
return endpoint + "/" + minioConfig.getBucketName() + "/" + fileUrl;
} else {
return "";
}

View File

@ -1,11 +1,11 @@
# Spring
spring:
spring:
application:
# 应用名称
name: bonus-system
profiles:
# 环境配置
active: jyy_canteen_test
active: jyy_canteen_local
task:
scheduling:
pool: