Skip to content

Commit 69fedf5

Browse files
committed
Remove debug logging statements from main and AuthMiddleware functions
1 parent 4361aac commit 69fedf5

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

main.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,6 @@ func main() {
5353
*conf = val
5454
}
5555
}
56-
57-
log.Printf("配置信息: %s", config)
58-
5956
// 路由设置
6057
http.HandleFunc("/login", loginHandler)
6158
if config.Dynamic == "true" {
@@ -350,10 +347,10 @@ func AuthMiddleware(next http.Handler) http.Handler {
350347
if config.Password != "" {
351348
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
352349
cookie, err := r.Cookie("auth")
353-
log.Printf("请求路径: %s, Cookie状态: %+v, 错误信息: %v", r.URL.Path, cookie, err)
350+
// log.Printf("请求路径: %s, Cookie状态: %+v, 错误信息: %v", r.URL.Path, cookie, err)
354351

355352
if err != nil || !verifyCookie(cookie) {
356-
log.Printf("验证失败,跳转登录页面")
353+
// log.Printf("验证失败,跳转登录页面")
357354
http.Redirect(w, r, "/login", http.StatusFound)
358355
return
359356
}

0 commit comments

Comments
 (0)