🐛 文件名包含 . 时的重命名问题 Fix https://github.com/siyuan-note/siyuan/issues/7686

This commit is contained in:
Liang Ding 2023-03-17 17:01:50 +08:00
parent 5971076749
commit 50e79b9476
No known key found for this signature in database
GPG key ID: 136F30F901A2231D

View file

@ -492,7 +492,7 @@ func RenameAsset(oldPath, newName string) (err error) {
return
}
newName = util.AssetName(newName) + filepath.Ext(oldPath)
newName = util.AssetName(newName + filepath.Ext(oldPath))
newPath := "assets/" + newName
if err = filelock.Copy(filepath.Join(util.DataDir, oldPath), filepath.Join(util.DataDir, newPath)); nil != err {
logging.LogErrorf("copy asset [%s] failed: %s", oldPath, err)