🐛 修复商品图标显示问题,移除测试道具 (#1817)

Co-authored-by: Flern <cb56ec362bbbfb5272eb941281299d8d-qq_connect@git.osc>
This commit is contained in:
HibiKier
2025-01-06 21:23:15 +08:00
committed by GitHub
co-authored by Flern
parent 2a5c06702a
commit 2f939ff52b
3 changed files with 16 additions and 139 deletions
+7 -2
View File
@@ -31,14 +31,19 @@ async def html_image() -> bytes:
goods[1].partition = "默认分区"
if goods[1].partition not in partition_dict:
partition_dict[goods[1].partition] = []
icon = None
if goods[1].icon:
icon = (
"data:image/png;base64,"
+ BuildImage.open(ICON_PATH / goods[1].icon).pic2bs4()[9:]
)
partition_dict[goods[1].partition].append(
{
"id": goods[0],
"price": goods[1].goods_price,
"daily_limit": goods[1].daily_limit or "∞",
"name": goods[1].goods_name,
"icon": "data:image/png;base64,"
+ BuildImage.open(ICON_PATH / goods[1].icon).pic2bs4()[9:],
"icon": icon,
"description": goods[1].goods_description,
}
)