From 8f4d20d3dd808af6cd31fb5b8613bc40f9791bb1 Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Tue, 3 Jan 2023 00:19:41 +0800 Subject: [PATCH] =?UTF-8?q?:sparkles:=20=E5=88=86=E4=BA=AB=E6=96=87?= =?UTF-8?q?=E6=A1=A3=E5=88=B0=E9=93=BE=E6=BB=B4=20https://github.com/siyua?= =?UTF-8?q?n-note/siyuan/issues/2004?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kernel/model/export.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/kernel/model/export.go b/kernel/model/export.go index 9b1c02132..a3f64e250 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 }