Initial commit

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
fish03
2026-09-23 14:43:16 +07:00
co-authored by Claude Opus 5.5
commit bef9f8b4ed
663 changed files with 81305 additions and 0 deletions
+39
View File
@@ -0,0 +1,39 @@
package web
import (
"videoweb/app/service/playletser"
"github.com/gin-gonic/gin"
)
// Index 首页 SSR:拉取 /api/app/playlet/home,直接用接口字段渲染。
func Index(c *gin.Context) {
renderIndex(c, "")
}
func AuthIndex(mode string) gin.HandlerFunc {
return func(c *gin.Context) {
renderIndex(c, mode)
}
}
func renderIndex(c *gin.Context, authMode string) {
authRedirect := c.Param("redirect")
raw := playletser.FetchHomeOrEmpty(c)
data := gin.H{
"title": "黄果短剧",
"navActive": "home",
"homeResponse": raw,
"seoInfo": raw.SeoInfo,
"announcements": raw.Announcements,
"homeCategoryData": raw.HomeCategoryData,
"homeRecommendThemes": raw.HomeRecommendThemes,
"homeBannerData": playletser.ActiveHomeBanners(raw.HomeBannerData),
"authMode": authMode,
"authRedirect": authRedirect,
}
if authMode != "" {
setNoIndex(data, true)
}
HTMLOK(c, "index.html", data)
}