feat: improve uploaded file URL

This commit is contained in:
Yang Luo
2024-08-26 21:41:28 +08:00
parent 65563fa0cd
commit dce0a96dea

View File

@ -100,12 +100,13 @@ func GetUploadFileUrl(provider *Provider, fullFilePath string, hasTimestamp bool
fileUrl := "" fileUrl := ""
if host != "" { if host != "" {
fileUrl = util.UrlJoin(host, escapePath(objectKey)) // fileUrl = util.UrlJoin(host, escapePath(objectKey))
fileUrl = util.UrlJoin(host, objectKey)
} }
if fileUrl != "" && hasTimestamp { // if fileUrl != "" && hasTimestamp {
fileUrl = fmt.Sprintf("%s?t=%s", fileUrl, util.GetCurrentUnixTime()) // fileUrl = fmt.Sprintf("%s?t=%s", fileUrl, util.GetCurrentUnixTime())
} // }
if provider.Type == ProviderTypeTencentCloudCOS { if provider.Type == ProviderTypeTencentCloudCOS {
objectKey = escapePath(objectKey) objectKey = escapePath(objectKey)