From 24421325d961f88d2bd79ab262f76ded2609f82c Mon Sep 17 00:00:00 2001 From: gazebo Date: Mon, 25 Mar 2019 18:10:57 +0800 Subject: [PATCH] =?UTF-8?q?-=20=E5=9C=A8=E7=94=A8=E6=88=B7=E5=90=8D?= =?UTF-8?q?=E4=B8=BA=E7=A9=BA=E6=97=B6=E5=B0=86ip=E5=BD=93=E6=88=90usernam?= =?UTF-8?q?e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxutils/jxcontext/jxcontext.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/business/jxutils/jxcontext/jxcontext.go b/business/jxutils/jxcontext/jxcontext.go index 28f2322fb..7085a10d8 100644 --- a/business/jxutils/jxcontext/jxcontext.go +++ b/business/jxutils/jxcontext/jxcontext.go @@ -83,6 +83,8 @@ func (ctx *Context) GetUserName() string { userName := ctx.token if ctx.userInfo != nil { userName = ctx.userInfo.GetUserTag() + } else if userName == "" { + userName = ctx.GetRealRemoteIP() } if len(userName) > MaxUserNameLen { userName = userName[:MaxUserNameLen]