style: 创建系统登录日志

This commit is contained in:
TsMask
2023-10-21 10:03:55 +08:00
parent d92696265d
commit 23141a8459
4 changed files with 10 additions and 10 deletions

View File

@@ -52,7 +52,7 @@ func (s *AccountController) Login(c *gin.Context) {
// 根据错误信息,创建系统访问记录
if err != nil {
msg := err.Error() + " " + loginBody.Code
s.sysLogLoginService.NewSysLogLogin(
s.sysLogLoginService.CreateSysLogLogin(
loginBody.Username, commonConstants.STATUS_NO, msg,
ipaddr, location, os, browser,
)
@@ -73,7 +73,7 @@ func (s *AccountController) Login(c *gin.Context) {
c.JSON(200, result.Err(nil))
return
} else {
s.sysLogLoginService.NewSysLogLogin(
s.sysLogLoginService.CreateSysLogLogin(
loginBody.Username, commonConstants.STATUS_YES, "登录成功",
ipaddr, location, os, browser,
)
@@ -133,7 +133,7 @@ func (s *AccountController) Logout(c *gin.Context) {
ipaddr, location := ctxUtils.IPAddrLocation(c)
os, browser := ctxUtils.UaOsBrowser(c)
// 创建系统访问记录
s.sysLogLoginService.NewSysLogLogin(
s.sysLogLoginService.CreateSysLogLogin(
userName, commonConstants.STATUS_YES, "退出成功",
ipaddr, location, os, browser,
)