mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 15:10:12 +01:00
Signed-off-by: Daniel <845765@qq.com>
This commit is contained in:
parent
b0f674d84c
commit
059b0022d0
1 changed files with 3 additions and 3 deletions
|
|
@ -98,7 +98,7 @@ func InsertLocalAssets(id string, assetAbsPaths []string, isUpload bool) (succMa
|
||||||
existAssetPath := GetAssetPathByHash(hash)
|
existAssetPath := GetAssetPathByHash(hash)
|
||||||
if "" != existAssetPath {
|
if "" != existAssetPath {
|
||||||
originalName := util.RemoveID(filepath.Base(existAssetPath))
|
originalName := util.RemoveID(filepath.Base(existAssetPath))
|
||||||
if fName != originalName {
|
if strings.ToLower(fName) != strings.ToLower(originalName) {
|
||||||
hash = "random_2_" + gulu.Rand.String(12)
|
hash = "random_2_" + gulu.Rand.String(12)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -213,13 +213,13 @@ func Upload(c *gin.Context) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if 1 > file.Size {
|
if 1 > file.Size {
|
||||||
hash = "empty_" + gulu.Rand.String(12)
|
hash = "random_1_" + gulu.Rand.String(12)
|
||||||
}
|
}
|
||||||
|
|
||||||
existAssetPath := GetAssetPathByHash(hash)
|
existAssetPath := GetAssetPathByHash(hash)
|
||||||
if "" != existAssetPath {
|
if "" != existAssetPath {
|
||||||
originalName := util.RemoveID(filepath.Base(existAssetPath))
|
originalName := util.RemoveID(filepath.Base(existAssetPath))
|
||||||
if fName != originalName {
|
if strings.ToLower(fName) != strings.ToLower(originalName) {
|
||||||
hash = "random_2_" + gulu.Rand.String(12)
|
hash = "random_2_" + gulu.Rand.String(12)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue