fix: 区分CDN与Minio内网地址配置
This commit is contained in:
+5
-2
@@ -64,5 +64,8 @@ consul:
|
||||
jaeger:
|
||||
addr: 192.168.0.83:4318
|
||||
|
||||
# 文件上传服务地址,与oss模块minio中的endpoint一致
|
||||
filePrefix: "http://192.168.0.83:9000"
|
||||
# 文件上传服务地址,cdn访问地址
|
||||
filePrefix: "http://cdn.redpowerfuture.com"
|
||||
|
||||
# 文件上传服务地址,minio内网访问地址
|
||||
minioPrefix: "http://192.168.0.83:9000"
|
||||
|
||||
@@ -505,7 +505,7 @@ func VideoConcat(ctx context.Context, videoUrls []string) (r any, err error) {
|
||||
}
|
||||
|
||||
func GetFileBytesFromURL(ctx context.Context, fileUrl string) ([]byte, error) {
|
||||
newS := strings.ReplaceAll(fileUrl, "http://cdn.redpowerfuture.com", g.Cfg().MustGet(ctx, "filePrefix").String())
|
||||
newS := strings.ReplaceAll(fileUrl, "http://cdn.redpowerfuture.com", g.Cfg().MustGet(ctx, "minioPrefix").String())
|
||||
// 使用 GoFrame 客户端(自带超时、追踪、日志等能力)
|
||||
resp, err := g.Client().Get(ctx, newS)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user