处理链接为默认值的问题

This commit is contained in:
2023-07-18 10:31:04 +08:00
parent 11c926fbfb
commit 12c5379d78
8 changed files with 37 additions and 27 deletions
+8
View File
@@ -9,3 +9,11 @@ import (
func RemoveOssDomain(url string) string {
return strings.Replace(url, config.C.Oss.OssCustomDomainName, "", 1)
}
// AddOssDomain 去除oss地址中的前缀
func AddOssDomain(url string) string {
if url == "" {
return ""
}
return config.C.Oss.OssCustomDomainName + url
}