From 8707f07d8a8e6726c17b2facea9a771d04e74f3d Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Mon, 2 Jan 2023 22:02:23 +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 | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/kernel/model/export.go b/kernel/model/export.go index e64918f2e..c5f204a91 100644 --- a/kernel/model/export.go +++ b/kernel/model/export.go @@ -100,9 +100,9 @@ func Export2Liandi(id string) (err error) { SetResult(result). SetCookies(&http.Cookie{Name: "symphony", Value: Conf.User.UserToken}). SetBody(map[string]interface{}{ - "title": title, - "tags": tags, - "content": content}) + "articleTitle": title, + "articleTags": tags, + "articleContent": content}) var resp *req.Response var sendErr error if foundArticle { @@ -120,6 +120,12 @@ func Export2Liandi(id string) (err error) { return errors.New(msg) } + if 0 != result.Code { + msg := fmt.Sprintf("send article to liandi failed [code=%d, msg=%s]", result.Code, result.Msg) + logging.LogErrorf(msg) + return errors.New(msg) + } + if !foundArticle { articleId = result.Data.(string) tree.Root.SetIALAttr("liandiArticleId", articleId)