check basicauth

This commit is contained in:
Ulric Qin 2021-12-31 12:07:23 +08:00
parent e9ce679649
commit b693e80d75
1 changed files with 4 additions and 1 deletions

View File

@ -231,7 +231,10 @@ func configRoute(r *gin.Engine, version string) {
pages.PUT("/busi-group/:id/task/*url", jwtAuth(), user(), perm("/job-tasks/put"), bgrw(), taskProxy) pages.PUT("/busi-group/:id/task/*url", jwtAuth(), user(), perm("/job-tasks/put"), bgrw(), taskProxy)
} }
service := r.Group("/v1/n9e", gin.BasicAuth(config.C.BasicAuth)) service := r.Group("/v1/n9e")
if len(config.C.BasicAuth) > 0 {
service.Use(gin.BasicAuth(config.C.BasicAuth))
}
{ {
service.Any("/prometheus/*url", prometheusProxy) service.Any("/prometheus/*url", prometheusProxy)
service.POST("/users", userAddPost) service.POST("/users", userAddPost)