fix(config)!: Token expire time (#145)

将配置中的过期时间单位统一为time.Duration,可以设置为`h`,`m`,`s`
This commit is contained in:
lejianwen
2025-02-17 10:49:59 +08:00
parent d85a00f748
commit c0346ff9e1
4 changed files with 14 additions and 14 deletions
+3 -2
View File
@@ -476,9 +476,10 @@ func (us *UserService) getAdminUserCount() int64 {
func (us *UserService) UserTokenExpireTimestamp() int64 {
exp := global.Config.App.TokenExpire
if exp == 0 {
exp = 3600 * 24 * 7
//默认七天
exp = 604800
}
return time.Now().Add(time.Second * time.Duration(exp)).Unix()
return time.Now().Add(exp).Unix()
}
func (us *UserService) RefreshAccessToken(ut *model.UserToken) {