Update home page

This commit is contained in:
2025-10-02 22:25:37 +08:00
parent 3a99d03427
commit 97ee74899c
4 changed files with 90 additions and 11 deletions

View File

@@ -158,10 +158,12 @@ func serveIndexHtml(c fiber.Ctx) error {
} else if path == "/" || path == "" {
pinned, err := service.GetPinnedResources()
random, err1 := service.RandomCover()
if err == nil && err1 == nil {
statistic, err2 := service.GetStatistic()
if err == nil && err1 == nil && err2 == nil {
preFetchDataJson, _ := json.Marshal(map[string]interface{}{
"pinned": pinned,
"background": random,
"statistic": statistic,
})
preFetchData = url.PathEscape(string(preFetchDataJson))
}