mirror of
https://gitee.com/XM-GO/PandaX.git
synced 2026-04-23 02:48:34 +08:00
【更新】修复
This commit is contained in:
@@ -85,22 +85,23 @@ func (u *UserApi) Login(rc *restfulx.ReqCtx) {
|
||||
Token: token,
|
||||
Expire: time.Now().Unix() + global.Conf.Jwt.ExpireTime,
|
||||
}
|
||||
|
||||
var loginLog logEntity.LogLogin
|
||||
ua := user_agent.New(rc.Request.Request.UserAgent())
|
||||
loginLog.Ipaddr = rc.Request.Request.RemoteAddr
|
||||
loginLog.LoginLocation = utils.GetRealAddressByIP(rc.Request.Request.RemoteAddr)
|
||||
loginLog.LoginTime = time.Now()
|
||||
loginLog.Status = "0"
|
||||
loginLog.Remark = rc.Request.Request.UserAgent()
|
||||
browserName, browserVersion := ua.Browser()
|
||||
loginLog.Browser = browserName + " " + browserVersion
|
||||
loginLog.Os = ua.OS()
|
||||
loginLog.Platform = ua.Platform()
|
||||
loginLog.Username = login.Username
|
||||
loginLog.Msg = "登录成功"
|
||||
loginLog.CreateBy = login.Username
|
||||
u.LogLogin.Insert(loginLog)
|
||||
go func() {
|
||||
var loginLog logEntity.LogLogin
|
||||
ua := user_agent.New(rc.Request.Request.UserAgent())
|
||||
loginLog.Ipaddr = rc.Request.Request.RemoteAddr
|
||||
loginLog.LoginLocation = utils.GetRealAddressByIP(rc.Request.Request.RemoteAddr)
|
||||
loginLog.LoginTime = time.Now()
|
||||
loginLog.Status = "0"
|
||||
loginLog.Remark = rc.Request.Request.UserAgent()
|
||||
browserName, browserVersion := ua.Browser()
|
||||
loginLog.Browser = browserName + " " + browserVersion
|
||||
loginLog.Os = ua.OS()
|
||||
loginLog.Platform = ua.Platform()
|
||||
loginLog.Username = login.Username
|
||||
loginLog.Msg = "登录成功"
|
||||
loginLog.CreateBy = login.Username
|
||||
u.LogLogin.Insert(loginLog)
|
||||
}()
|
||||
}
|
||||
|
||||
// Auth 用户权限信息
|
||||
|
||||
@@ -45,7 +45,7 @@ func (p *{{.ClassName}}Api) Get{{.ClassName}}List(rc *restfulx.ReqCtx) {
|
||||
// Get{{.ClassName}} 获取{{.FunctionName}}
|
||||
func (p *{{.ClassName}}Api) Get{{.ClassName}}(rc *restfulx.ReqCtx) {
|
||||
{{.PkJsonField}} := restfulx.PathParamInt(rc, "{{.PkJsonField}}")
|
||||
p.{{.ClassName}}App.FindOne(int64({{.PkJsonField}}))
|
||||
rc.ResData = p.{{.ClassName}}App.FindOne(int64({{.PkJsonField}}))
|
||||
}
|
||||
|
||||
// Insert{{.ClassName}} 添加{{.FunctionName}}
|
||||
|
||||
Reference in New Issue
Block a user