Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add lastUsedAt for classic token #547
feat: add lastUsedAt for classic token #547
Changes from all commits
5aaf6cf
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这段代码是一个
UserRoleManager
类中的一部分。代码检查了令牌是否过期,并设置了lastUsedAt
的值。在修改的代码行中,将调用
checkTokenExpired
方法改为了checkTokenStatus
方法。对于代码的风险和改进建议,我目前无法提供详细信息,因为我无法看到完整的代码上下文和相关代码。但是,根据给出的部分代码,没有明显的错误或问题,而且修改似乎只是用不同的方法名替换了原有的方法名。
如果您提供更多的上下文或代码细节,我可能能够给出更具体的反馈。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这段代码看起来是一个关于TokenController的测试。
潜在的问题和改进建议如下:
dayjs
库之后没有执行npm install
命令,可能会导致缺少依赖。需要确保安装了dayjs
库。TestUtil.createUser()
创建用户并获取authorization
。然而,在之后没有清理创建的用户或回滚对数据库的更改。建议在测试运行结束后进行清理操作,以确保数据库的一致性。lastUsedAt
属性是否在当前时间之后,但是使用了Date.now()
来获取当前时间。为了准确比较时间,建议使用dayjs
库提供的方法来获取当前时间,例如dayjs().valueOf()
。总体上看,代码比较简洁,没有明显的错误。以上是一些建议和潜在问题,供参考。