Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
shiguanghuxian committed Sep 29, 2019
2 parents f8dc6e3 + ba2cf5d commit 248ee23
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion program/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,12 @@ func (p *Program) startAPI() {
}

// v1 api
apiV1 := router.Group("/v1", gin.BasicAuth(accounts))
var apiV1 *gin.RouterGroup
if len(accounts) > 0 {
apiV1 = router.Group("/v1", gin.BasicAuth(accounts))
} else {
apiV1 = router.Group("/v1")
}
apiV1.Use(p.middlewareEtcd()) // 注入etcd客户端
v1.V1(apiV1)

Expand Down

0 comments on commit 248ee23

Please sign in to comment.