mirror of
https://github.com/bufanyun/hotgo.git
synced 2025-08-28 15:41:04 +08:00
统一应用路由前缀规则
This commit is contained in:
@@ -7,10 +7,11 @@ package router
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/net/ghttp"
|
||||
api "hotgo/api/home/base"
|
||||
"hotgo/internal/consts"
|
||||
"hotgo/internal/controller/home/base"
|
||||
"hotgo/utility/simple"
|
||||
)
|
||||
|
||||
// Home 前台页面路由
|
||||
@@ -20,8 +21,7 @@ func Home(ctx context.Context, group *ghttp.RouterGroup) {
|
||||
_, _ = base.Site.Index(r.Context(), &api.SiteIndexReq{})
|
||||
})
|
||||
|
||||
prefix := g.Cfg().MustGet(ctx, "router.home.prefix", "/home")
|
||||
group.Group(prefix.String(), func(group *ghttp.RouterGroup) {
|
||||
group.Group(simple.RouterPrefix(ctx, consts.AppHome), func(group *ghttp.RouterGroup) {
|
||||
group.Bind(
|
||||
base.Site, // 基础
|
||||
)
|
||||
|
Reference in New Issue
Block a user