From f5bb0cad3e2d724cbc02877dd70912ea1bf74a92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E4=B8=80=E4=B9=8B?= Date: Fri, 21 Jul 2023 22:46:55 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=AE=B0=E5=BD=95ip?= =?UTF-8?q?=E4=B8=8E=E5=BD=92=E5=B1=9E=E5=9C=B0=E4=BF=A1=E6=81=AF=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/internal/sys/api/account.go | 2 +- server/internal/sys/api/auth.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/server/internal/sys/api/account.go b/server/internal/sys/api/account.go index f1b4aa27..9cc43709 100644 --- a/server/internal/sys/api/account.go +++ b/server/internal/sys/api/account.go @@ -193,7 +193,7 @@ func (a *Account) OtpVerify(rc *req.Ctx) { la := &entity.Account{Username: otpInfo.Username} la.Id = accountId - go saveLogin(a.AccountApp, a.MsgApp, la, rc.GinCtx.ClientIP()) + go saveLogin(a.AccountApp, a.MsgApp, la, getIpAndRegion(rc)) cache.Del(tokenKey) rc.ResData = accessToken diff --git a/server/internal/sys/api/auth.go b/server/internal/sys/api/auth.go index d1e3e7dd..9440becb 100644 --- a/server/internal/sys/api/auth.go +++ b/server/internal/sys/api/auth.go @@ -186,7 +186,7 @@ func (a *Auth) OAuth2Callback(rc *req.Ctx) { accessToken = otpToken } else { // 保存登录消息 - go saveLogin(a.AccountApp, a.MsgApp, account, rc.GinCtx.ClientIP()) + go saveLogin(a.AccountApp, a.MsgApp, account, getIpAndRegion(rc)) } // 赋值otp状态 res["action"] = "oauthLogin"