Skip to content
This repository was archived by the owner on Sep 17, 2019. It is now read-only.

Commit bb2ce26

Browse files
committed
修改: controllers/roles.go
修改: routers/router.go
1 parent 128953b commit bb2ce26

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

‎controllers/roles.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ func (h *RolesController) Prepare() {
4848
}
4949

5050
// @Title getAllRoles
51-
// @route / [get]
51+
// @router / [get]
5252
func (h *RolesController) GetAll() {
5353
limit, _ := h.GetInt("limit", 0)
5454
index, _ := h.GetInt("index", 0)

‎routers/router.go‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import (
1616
"github.com/astaxie/beego/context"
1717
)
1818

19+
// Show web
1920
func StaticFileServer(ctx *context.Context) {
2021
if strings.HasPrefix(ctx.Input.URL(), "/api") {
2122
return
@@ -26,8 +27,6 @@ func StaticFileServer(ctx *context.Context) {
2627

2728
func init() {
2829
beego.ErrorController(&controllers.ErrorController{})
29-
beego.InsertFilter("/", beego.BeforeRouter, StaticFileServer)
30-
beego.InsertFilter("/*", beego.BeforeRouter, StaticFileServer)
3130
ns := beego.NewNamespace("/api/v1",
3231
beego.NSNamespace("/hosts",
3332
beego.NSInclude(
@@ -101,4 +100,6 @@ func init() {
101100
),
102101
)
103102
beego.AddNamespace(ns)
103+
beego.InsertFilter("/", beego.BeforeRouter, StaticFileServer)
104+
beego.InsertFilter("/*", beego.BeforeRouter, StaticFileServer)
104105
}

0 commit comments

Comments
 (0)