瀏覽代碼

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

duxin 1 年之前
父節點
當前提交
47b604dcb7
共有 1 個文件被更改,包括 9 次插入2 次删除
  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
 	s_url := l.R.RequestURI
 	md, _ := json.Marshal(l.R.Form)
 	md, _ := json.Marshal(l.R.Form)
 	str := string(md)
 	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{}{
 	logs := map[string]interface{}{
 		"date":      timeNow.Unix(),
 		"date":      timeNow.Unix(),
 		"ip":        util.GetIp(l.R),
 		"ip":        util.GetIp(l.R),