Browse Source

Merge branch 'dev/v4.8.52_dx' of qmx/jy into feature/v4.8.52

duxin 1 year ago
parent
commit
47b604dcb7
1 changed files with 9 additions and 2 deletions
  1. 9 2
      src/jfw/filter/logfilter.go

+ 9 - 2
src/jfw/filter/logfilter.go

@@ -98,8 +98,15 @@ func (l *logFilter) addLog() {
 	s_url := l.R.RequestURI
 	md, _ := json.Marshal(l.R.Form)
 	str := string(md)
-	eid, _ := l.R.Cookie("eid")
-	fid, _ := l.R.Cookie("fid")
+	var eid, fid string
+	eidCookie, _ := l.R.Cookie("eid")
+	if eidCookie != nil {
+		eid = eidCookie.Value
+	}
+	fidCookie, _ := l.R.Cookie("fid")
+	if fidCookie != nil {
+		fid = fidCookie.Value
+	}
 	logs := map[string]interface{}{
 		"date":      timeNow.Unix(),
 		"ip":        util.GetIp(l.R),