This commit is contained in:
Liang Ding 2023-01-03 00:19:41 +08:00
parent bb0ebefb1d
commit 8f4d20d3dd
No known key found for this signature in database
GPG key ID: 136F30F901A2231D

View file

@ -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
}