From 1467568f1d52f62256b71df9e9019cf6c0af46a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A1=9C=E8=8F=AF?= Date: Sun, 13 Aug 2023 08:07:33 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=BE=E7=89=87=E9=A2=84=E8=A7=88=E5=9C=B0?= =?UTF-8?q?=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- routers/images.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/routers/images.go b/routers/images.go index d467ce2..e0c89fe 100644 --- a/routers/images.go +++ b/routers/images.go @@ -117,9 +117,11 @@ func ImagesGet(w http.ResponseWriter, r *http.Request) { } db.Offset((listview.Page - 1) * listview.PageSize).Limit(listview.PageSize).Preload("User").Find(&image_list).Count(&listview.Total) - for _, image := range image_list { + + // 修改图片预览地址 + for index, image := range image_list { if image.Preview == "" { - image.Preview = "https://image.gameuiux.cn/2023/06/27/1687851028u=3116699095,2862677591&fm=253&fmt=auto&app=120&f=JPEG.webp" + image_list[index].Preview = fmt.Sprintf("/images/%s.%s", image.Hash, image.Format) } }