This commit is contained in:
PandaGoAdmin
2021-12-17 11:55:49 +08:00
parent b6b95566e3
commit da9e1cf29c
13 changed files with 134 additions and 47 deletions

View File

@@ -99,6 +99,7 @@ func (u *UserApi) Login(rc *ctx.ReqCtx) {
var loginLog entity.LogLogin
ua := user_agent.New(rc.GinCtx.Request.UserAgent())
loginLog.Ipaddr = rc.GinCtx.ClientIP()
loginLog.LoginLocation = utils.GetRealAddressByIP(rc.GinCtx.ClientIP())
loginLog.LoginTime = time.Now()
loginLog.Status = "0"
loginLog.Remark = rc.GinCtx.Request.UserAgent()
@@ -108,6 +109,7 @@ func (u *UserApi) Login(rc *ctx.ReqCtx) {
loginLog.Platform = ua.Platform()
loginLog.Username = login.Username
loginLog.Msg = "登录成功"
loginLog.CreateBy = login.Username
u.LogLogin.Insert(loginLog)
}