Skip to content

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

:sparkles: 分享文档到链滴 https://github.com/siyuan-note/siyuan/issues/2004

Liang Ding8f4d20d3dd80
diff --git a/kernel/model/export.go b/kernel/model/export.go
index 9b1c02132b..a3f64e2503 100644
--- a/kernel/model/export.go
+++ b/kernel/model/export.go
@@ -68,8 +68,9 @@ func Export2Liandi(id string) (err error) {
defer util.PushClearMsg(msgId)
// 判断帖子是否已经存在,存在则使用更新接口
+ const liandiArticleIdAttrName = "custom-liandi-articleId"
foundArticle := false
- articleId := tree.Root.IALAttr("liandiArticleId")
+ articleId := tree.Root.IALAttr(liandiArticleIdAttrName)
if "" != articleId {
request := httpclient.NewCloudRequest30s()
resp, getErr := request.
@@ -140,7 +141,7 @@ func Export2Liandi(id string) (err error) {
if !foundArticle {
articleId = result.Data.(string)
tree, _ = loadTreeByBlockID(id) // 这里必须重新加载,因为前面导出时已经修改了树结构
- tree.Root.SetIALAttr("liandiArticleId", articleId)
+ tree.Root.SetIALAttr(liandiArticleIdAttrName, articleId)
if err = writeJSONQueue(tree); nil != err {
return
}