mirror of
https://codeberg.org/VnPower/PixivFE
synced 2024-12-06 19:16:23 +01:00
35 lines
828 B
Go
35 lines
828 B
Go
package pages
|
|
|
|
// import (
|
|
// session "codeberg.org/vnpower/pixivfe/v2/core/config"
|
|
// core "codeberg.org/vnpower/pixivfe/v2/core/webapi"
|
|
// "github.com/gofiber/fiber/v2"
|
|
// )
|
|
|
|
// func IndexPage(c *fiber.Ctx) error {
|
|
|
|
// // If token is set, do the landing request...
|
|
// if token := session.CheckToken(c); token != "" {
|
|
// mode := c.Query("mode", "all")
|
|
|
|
// works, err := core.GetLanding(c, mode)
|
|
|
|
// if err != nil {
|
|
// return err
|
|
// }
|
|
|
|
// return c.Render("pages/index", fiber.Map{
|
|
// "Title": "Landing", "Data": works,
|
|
// })
|
|
// }
|
|
|
|
// // ...otherwise, default to today's illustration ranking
|
|
// works, err := core.GetRanking(c, "daily", "illust", "", "1")
|
|
// if err != nil {
|
|
// return err
|
|
// }
|
|
// return c.Render("pages/index", fiber.Map{
|
|
// "Title": "Landing", "NoTokenData": works,
|
|
// })
|
|
// }
|