瀏覽代碼

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

Daniel 10 月之前
父節點
當前提交
52877f42d0
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      kernel/model/upload.go

+ 2 - 2
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), "/")
 		}
 	}