Browse Source

提交代码。

Signed-off-by: zouap <zouap@pcl.ac.cn>
tags/v1.21.12.1
zouap 3 years ago
parent
commit
762f2e3117
1 changed files with 5 additions and 1 deletions
  1. +5
    -1
      models/user_login_log.go

+ 5
- 1
models/user_login_log.go View File

@@ -32,7 +32,11 @@ func SaveLoginInfoToDb(r *http.Request, u *User) {

func getIP(r *http.Request) string {
headerjson, _ := json.Marshal(r.Header)
log.Info("json=" + string(headerjson))
log.Info("header json=" + string(headerjson))

reqjson, _ := json.Marshal(r)
log.Info("request json=" + string(reqjson))

forwarded := r.Header.Get("X-FORWARDED-FOR")
if forwarded != "" {
return forwarded


Loading…
Cancel
Save