|
|
@@ -30,6 +30,17 @@ func ImageFormatWithBucketNew(scheme, domain, name string) string { |
|
|
|
return name |
|
|
|
} |
|
|
|
|
|
|
|
name = strings.ReplaceAll(name, "{{host}}", "") |
|
|
|
name = strings.ReplaceAll(name, "{{tempHost}}", "") |
|
|
|
return fmt.Sprintf("%s://%s/%s", scheme, domain, name) |
|
|
|
} |
|
|
|
|
|
|
|
// ImageFormatWithBucketForDataInfo is 格式化成oss 域名 (只格式化内容中的 url) |
|
|
|
func ImageFormatWithBucketForDataInfo(scheme, domain, name string) string { |
|
|
|
if strings.Contains(name, "http") { |
|
|
|
return name |
|
|
|
} |
|
|
|
|
|
|
|
prefix := fmt.Sprintf("%s://%s/", scheme, domain) |
|
|
|
name = strings.ReplaceAll(name, "{{tempHost}}", prefix) |
|
|
|
return name |
|
|
|
} |