Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: Improve asset name normalization when inserting/uploading https://github.com/siyuan-note/siyuan/issues/12255

Daniel52877f42d0c7
diff --git a/kernel/model/upload.go b/kernel/model/upload.go
index ad57efe60b..65e7d80a3c 100644
--- a/kernel/model/upload.go
+++ b/kernel/model/upload.go
@@ -100,7 +100,7 @@ func InsertLocalAssets(id string, assetPaths []string, isUpload bool) (succMap m
return
}
f.Close()
- succMap[baseName] = "assets/" + fName
+ succMap[fName] = "assets/" + fName
}
}
IncSync()
@@ -284,7 +284,7 @@ func Upload(c *gin.Context) {
os.RemoveAll(tmpDir2)
}
- succMap[baseName] = strings.TrimPrefix(path.Join(relAssetsDirPath, fName), "/")
+ succMap[fName] = strings.TrimPrefix(path.Join(relAssetsDirPath, fName), "/")
}
}