Signed-off-by: Daniel <845765@qq.com>
This commit is contained in:
Daniel 2025-12-15 10:46:56 +08:00
parent b0f674d84c
commit 059b0022d0
No known key found for this signature in database
GPG key ID: 86211BA83DF03017

View file

@ -98,7 +98,7 @@ func InsertLocalAssets(id string, assetAbsPaths []string, isUpload bool) (succMa
existAssetPath := GetAssetPathByHash(hash)
if "" != existAssetPath {
originalName := util.RemoveID(filepath.Base(existAssetPath))
if fName != originalName {
if strings.ToLower(fName) != strings.ToLower(originalName) {
hash = "random_2_" + gulu.Rand.String(12)
}
}
@ -213,13 +213,13 @@ func Upload(c *gin.Context) {
}
if 1 > file.Size {
hash = "empty_" + gulu.Rand.String(12)
hash = "random_1_" + gulu.Rand.String(12)
}
existAssetPath := GetAssetPathByHash(hash)
if "" != existAssetPath {
originalName := util.RemoveID(filepath.Base(existAssetPath))
if fName != originalName {
if strings.ToLower(fName) != strings.ToLower(originalName) {
hash = "random_2_" + gulu.Rand.String(12)
}
}