fix: 首次引导tokan未记录

This commit is contained in:
TsMask
2025-04-27 18:44:48 +08:00
parent 5abfc7feb6
commit 2a0f0c46ca

View File

@@ -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)
// 生成访问令牌
@@ -67,6 +69,8 @@ func (s *BootloaderController) Start(c *gin.Context) {
c.JSON(200, resp.ErrMsg("token generation failed"))
return
}
// 记录令牌,创建系统访问记录
token.UserInfoCreate(&info, deviceFingerprint, [4]string{ipaddr, location, os, browser})
// 创建系统访问记录
s.accountService.UpdateLoginDateAndIP(info)