🐛 (reviews): 评论配图带上微信阅读来源

空地址丢掉。没有图时不给出图片列表。

关联 #148
This commit is contained in:
Garfield committed 2026-11-26 16:55:31 +08:00
1 parent a890c230ac
commit 7b3eeb8fe6
2 files changed
+47

No files matched your search

+21
View File
@@ -79,6 +79,27 @@ do
review = { content = "点评", createTime = 1, author = { name = "甲" } },
})
Assert.eq(with_replies.replies, 4)
Assert.is_nil(with_replies.images)
local pictured = Reviews.item({
reviewId = "pic", likesCount = 2,
review = {
content = "带图", createTime = 3, author = { name = "甲" },
pictures = {
{ url = "https://weread-picture.example/a.png", width = 800, height = 1067 },
{ url = "", width = 1, height = 1 },
},
},
})
Assert.len(pictured.images, 1)
Assert.eq(pictured.images[1].url, "https://weread-picture.example/a.png")
Assert.eq(pictured.images[1].width, 800)
Assert.eq(pictured.images[1].height, 1067)
Assert.eq(pictured.images[1].headers.Referer, "https://weread.qq.com/")
local reply = Reviews.commentItem({
commentId = "c", content = "回复", createTime = 4, author = { name = "乙" },
pictures = { { url = "https://weread-picture.example/b.png", width = 40, height = 40 } },
})
Assert.eq(reply.images[1].url, "https://weread-picture.example/b.png")
end
do -- 想法下的评论页:楼中楼只记被回复者;空列表但声称有条数是失败;游标不前进就停