fix
This commit is contained in:
@@ -141,7 +141,7 @@ func BenchmarkJWT(b *testing.B) {
|
||||
|
||||
for i := 0; i < b.N; i++ {
|
||||
claims := &jwt.StandardClaims{
|
||||
ExpiresAt: time.Now().Unix() + 1020213021,
|
||||
ExpiresAt: time.Now().UTC().Unix() + 1020213021,
|
||||
Issuer: "test",
|
||||
}
|
||||
|
||||
|
||||
@@ -2,10 +2,10 @@ package basic
|
||||
|
||||
import (
|
||||
"crypto/sha256"
|
||||
"encoding/base64"
|
||||
"fusenapi/utils/auth"
|
||||
"log"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
func TestRequestParse(t *testing.T) {
|
||||
@@ -17,7 +17,9 @@ func TestHash(t *testing.T) {
|
||||
a := "fs12345678"
|
||||
h := sha256.New()
|
||||
h.Write([]byte(a))
|
||||
s := base64.RawURLEncoding.EncodeToString(h.Sum(nil))
|
||||
s := "5JlPincPavgw0X/Fmj15xLId5vOEtdarc6hR1XlBx80="
|
||||
|
||||
log.Println(auth.GenerateJwtTokenUint64(auth.StringToHash(s), 421231233, time.Now().UTC().Unix(), 39, 0))
|
||||
key := auth.StringToHash(s)
|
||||
log.Println(key)
|
||||
// log.Println(auth.GenerateJwtTokenUint64(auth.StringToHash(s), 400000000, time.Now().UTC().Unix(), 39, 0))
|
||||
|
||||
Reference in New Issue
Block a user