增加访问ip打印等功能

This commit is contained in:
2020-02-20 15:06:39 +08:00
parent 0f29b3304e
commit 6eca18b374
4 changed files with 43 additions and 13 deletions
+6
View File
@@ -14,6 +14,7 @@ import (
"path/filepath"
"strconv"
"strings"
"time"
)
type Application struct {
@@ -330,6 +331,11 @@ func (this *Application) handler(w http.ResponseWriter, req *http.Request) {
//跨域设置
CrossDomain(&context)
//是否展示日志
if this.Config.GetInt("connectLogShow") != 0 {
log.Println(context.HandlerStr + time.Now().Format(" 2006-01-02 15:04 ") + Substr(context.Req.RemoteAddr, 0, strings.Index(context.Req.RemoteAddr, ":")))
}
//访问拦截true继续false暂停
connectListenerLen := len(this.connectListener)
if connectListenerLen != 0 {