fix: token expiration time

Signed-off-by: hongming <talonwan@yunify.com>
This commit is contained in:
hongming
2019-07-05 21:30:11 +08:00
committed by zryfish
parent 738920a3fa
commit 6c7f4519cb

View File

@@ -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