Skip to content

Commit afa162f

Browse files
committed
页面内容和父亲id相同才不需要重新渲染
1 parent 971a581 commit afa162f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

api_content.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,10 +175,12 @@ func (cli *Client) PageFindOrCreateBySpaceAndTitle(space, parentId, title, wikiD
175175

176176
// 获取文件的路径
177177
pagePath := ""
178+
lastAncestorId := ""
178179
for i, ancestor := range content.Ancestors {
179180
if i != 0 {
180181
pagePath += "/" + ancestor.Title
181182
}
183+
lastAncestorId = ancestor.Id
182184
}
183185

184186
//存在,但不在指定的路径下,报错结束
@@ -196,7 +198,7 @@ func (cli *Client) PageFindOrCreateBySpaceAndTitle(space, parentId, title, wikiD
196198
return Content{}, fmt.Errorf("转换旧内容失败: %s", err)
197199
}
198200

199-
if newValue == oldValue {
201+
if newValue == oldValue && lastAncestorId == parentId {
200202
return content, nil
201203
}
202204

0 commit comments

Comments
 (0)