提交 6c7f4519 编写于 作者: H hongming 提交者: zryfish

fix: token expiration time

Signed-off-by: Nhongming <talonwan@yunify.com>
上级 738920a3
......@@ -285,7 +285,9 @@ func Login(username string, password string, ip string) (*models.Token, error) {
claims := jwt.MapClaims{}
claims["exp"] = time.Now().Add(tokenExpireTime).Unix()
if tokenExpireTime > 0 {
claims["exp"] = time.Now().Add(tokenExpireTime).Unix()
}
claims["username"] = uid
claims["email"] = email
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册