Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion server/api/v1/system/sys_user.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ func (b *BaseApi) SetUserAuthority(c *gin.Context) {
}
c.Header("new-token", token)
c.Header("new-expires-at", strconv.FormatInt(claims.ExpiresAt.Unix(), 10))
utils.SetToken(c, token, int((claims.ExpiresAt.Unix()-time.Now().Unix())/60))
utils.SetToken(c, token, int(claims.ExpiresAt.Unix()-time.Now().Unix()))
response.OkWithMessage("修改成功", c)
}

Expand Down
2 changes: 1 addition & 1 deletion server/utils/claims.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func GetToken(c *gin.Context) string {
global.GVA_LOG.Error("重新写入cookie token失败,未能成功解析token,请检查请求头是否存在x-token且claims是否为规定结构")
return token
}
SetToken(c, token, int((claims.ExpiresAt.Unix()-time.Now().Unix())/60))
SetToken(c, token, int(claims.ExpiresAt.Unix()-time.Now().Unix()))
}
return token
}
Expand Down