logo和配置修改
This commit is contained in:
@@ -9,7 +9,6 @@ import (
|
||||
"strings"
|
||||
"videoweb/app/api/web"
|
||||
"videoweb/app/appg"
|
||||
"videoweb/app/service/configser"
|
||||
"videoweb/app/service/playletser"
|
||||
"videoweb/app/service/seoser"
|
||||
|
||||
@@ -62,7 +61,6 @@ func setupEngine(engine *gin.Engine) {
|
||||
tplFuncs := playletser.TemplateFuncs()
|
||||
tplFuncs["InJSONScript"] = inJSONScript
|
||||
tplFuncs["jsonStr"] = jsonStr
|
||||
tplFuncs["InTrackerAppId"] = inTrackerAppId
|
||||
engine.SetFuncMap(tplFuncs)
|
||||
engine.LoadHTMLFiles(listHTMLTemplates("templates")...)
|
||||
engine.Use(staticCacheHeaders(), crawlerHeaders())
|
||||
@@ -145,42 +143,19 @@ func jsonStr(s string) template.JS {
|
||||
return template.JS(b)
|
||||
}
|
||||
|
||||
func inTrackerAppId() string {
|
||||
return configser.ResolveTrackerAppID()
|
||||
}
|
||||
|
||||
func registerRoutes(r *gin.Engine) {
|
||||
r.GET("/", web.Index)
|
||||
r.GET("/ui/dialog/:name", web.DialogFragment)
|
||||
|
||||
r.POST("/api/auth/register", web.Register)
|
||||
r.POST("/api/auth/login", web.Login)
|
||||
r.POST("/api/auth/resetPassword", web.ResetPassword)
|
||||
r.POST("/api/auth/guest", web.Guest)
|
||||
r.POST("/api/auth/logout", web.Logout)
|
||||
r.POST("/api/auth/profile", web.UpdateProfile)
|
||||
r.GET("/api/auth/getInfo", web.GetUserInfo)
|
||||
r.POST("/api/upload/image", web.UploadImage)
|
||||
r.POST("/api/feedback/add", web.AddFeedback)
|
||||
r.POST("/api/contactus/add", web.AddContactUs)
|
||||
r.GET("/api/comment/list", web.CommentList)
|
||||
r.POST("/api/comment/send", web.CommentSend)
|
||||
r.POST("/api/comment/like/set", web.CommentLikeSet)
|
||||
r.POST("/api/playlet/like/set", web.PlayletLikeSet)
|
||||
r.POST("/api/playlet/collect/set", web.PlayletCollectSet)
|
||||
r.POST("/api/playlet/forward/heat", web.PlayletForwardHeat)
|
||||
r.GET("/api/playlet/chapter/detail", web.ChapterDetail)
|
||||
r.GET("/api/playlet/chapter/list", web.ChapterList)
|
||||
r.GET("/api/playlet/operate/list", web.OperateList)
|
||||
r.GET("/api/playlet/hot-like", web.HotLike)
|
||||
r.GET("/api/app/playlet/hot-like", web.HotLike)
|
||||
r.POST("/api/playlet/chapter/like/set", web.ChapterLikeSet)
|
||||
r.POST("/api/playlet/chapter/collect/set", web.ChapterCollectSet)
|
||||
r.POST("/api/playlet/chapter/watch/report", web.ChapterWatchReport)
|
||||
r.POST("/api/playlet/history/clear", web.HistoryClear)
|
||||
r.POST("/api/playlet/chapter/unlock", web.ChapterUnlock)
|
||||
r.POST("/api/coin/buy", web.CoinBuy)
|
||||
r.POST("/api/vip/pay", web.VipPay)
|
||||
|
||||
r.GET("/list/", web.List)
|
||||
r.GET("/list/:slug/", web.List)
|
||||
@@ -239,26 +214,6 @@ func registerRoutes(r *gin.Engine) {
|
||||
r.GET("/play/:slug/", web.Play)
|
||||
r.GET("/play/:slug/:chapterId/", web.Play)
|
||||
|
||||
r.GET("/login/", web.AuthIndex("login"))
|
||||
r.GET("/login/return/*redirect", web.AuthIndex("login"))
|
||||
r.GET("/register/", web.AuthIndex("register"))
|
||||
|
||||
r.GET("/user-center/", web.UserCenter)
|
||||
|
||||
r.GET("/deposit/", web.Deposit)
|
||||
r.GET("/deposit/:tab/", web.Deposit)
|
||||
|
||||
r.GET("/collect/", web.Collect)
|
||||
r.GET("/collect/page/:page/", web.Collect)
|
||||
r.GET("/collect/:type/", web.Collect)
|
||||
r.GET("/collect/:type/page/:page/", web.Collect)
|
||||
|
||||
r.GET("/history/", web.History)
|
||||
r.GET("/history/page/:page/", web.History)
|
||||
|
||||
r.GET("/setting/", web.Setting)
|
||||
r.GET("/edit-profile/", web.EditProfile)
|
||||
r.GET("/edit-password/", web.EditPassword)
|
||||
r.GET("/search/", web.Search)
|
||||
r.GET("/search/:keyword/", web.Search)
|
||||
r.GET("/search/:keyword/page/:page/", web.Search)
|
||||
|
||||
@@ -46,7 +46,6 @@ func TestContentPagesOnlyRegisterPathParameterRoutes(t *testing.T) {
|
||||
}
|
||||
}
|
||||
for _, route := range []string{
|
||||
"POST /api/auth/resetPassword",
|
||||
"POST /api/contactus/add",
|
||||
"GET /api/playlet/chapter/list",
|
||||
"GET /api/playlet/operate/list",
|
||||
|
||||
@@ -48,9 +48,8 @@ func TestMainSiteKeepsMainVerificationAndAnalytics(t *testing.T) {
|
||||
func renderSEOCommonForTrackingTest(t *testing.T, isNavPage bool) string {
|
||||
t.Helper()
|
||||
tpl, err := template.New("tracking-test").Funcs(template.FuncMap{
|
||||
"InTrackerAppId": func() string { return "test-app" },
|
||||
"jsonStr": func(any) template.JS { return template.JS(`""`) },
|
||||
}).ParseFiles("../templates/base/seoCommon.html", "../templates/base/trackerInit.html")
|
||||
}).ParseFiles("../templates/base/seoCommon.html", "../templates/base/analytics.html")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -58,8 +57,7 @@ func renderSEOCommonForTrackingTest(t *testing.T, isNavPage bool) string {
|
||||
"isNavPage": isNavPage,
|
||||
"seoVerify": map[string]any{"Baidu": ""},
|
||||
"appConfig": map[string]any{
|
||||
"ReportSDKConfig": "",
|
||||
"SeoInfo": map[string]any{"WebSiteName": ""},
|
||||
"SeoInfo": map[string]any{"WebSiteName": ""},
|
||||
},
|
||||
}
|
||||
var out bytes.Buffer
|
||||
|
||||
Reference in New Issue
Block a user