fix: 首次引导tokan未记录
This commit is contained in:
@@ -59,6 +59,8 @@ func (s *BootloaderController) Start(c *gin.Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 当前请求信息
|
// 当前请求信息
|
||||||
|
ipaddr, location := reqctx.IPAddrLocation(c)
|
||||||
|
os, browser := reqctx.UaOsBrowser(c)
|
||||||
deviceFingerprint := reqctx.DeviceFingerprint(c, info.UserId)
|
deviceFingerprint := reqctx.DeviceFingerprint(c, info.UserId)
|
||||||
|
|
||||||
// 生成访问令牌
|
// 生成访问令牌
|
||||||
@@ -67,6 +69,8 @@ func (s *BootloaderController) Start(c *gin.Context) {
|
|||||||
c.JSON(200, resp.ErrMsg("token generation failed"))
|
c.JSON(200, resp.ErrMsg("token generation failed"))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
// 记录令牌,创建系统访问记录
|
||||||
|
token.UserInfoCreate(&info, deviceFingerprint, [4]string{ipaddr, location, os, browser})
|
||||||
// 创建系统访问记录
|
// 创建系统访问记录
|
||||||
s.accountService.UpdateLoginDateAndIP(info)
|
s.accountService.UpdateLoginDateAndIP(info)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user