This commit is contained in:
Daniel 2025-03-15 16:54:47 +08:00
parent 6407791fbb
commit 8418e3a454
No known key found for this signature in database
GPG Key ID: 86211BA83DF03017

View File

@ -278,6 +278,15 @@ func parseJSON2Tree(boxID, p string, jsonData []byte, luteEngine *lute.Lute) (re
needFix = true needFix = true
logging.LogInfof("migrated tree [%s] from spec [%s] to [%s]", filePath, oldSpec, ret.Root.Spec) logging.LogInfof("migrated tree [%s] from spec [%s] to [%s]", filePath, oldSpec, ret.Root.Spec)
} }
if pathID := util.GetTreeID(p); pathID != ret.Root.ID {
needFix = true
ret.Root.ID = pathID
ret.ID = pathID
ret.Root.SetIALAttr("id", ret.ID)
logging.LogInfof("reset tree id from [%s] to [%s]", ret.Root.ID, pathID)
}
if needFix { if needFix {
renderer := render.NewJSONRenderer(ret, luteEngine.RenderOptions) renderer := render.NewJSONRenderer(ret, luteEngine.RenderOptions)
data := renderer.Render() data := renderer.Render()