debug toekn
This commit is contained in:
parent
87d49e2c18
commit
984134aaec
|
@ -198,6 +198,9 @@ func GenerateBaseJwtTokenUint64(AccessSecret uint64, accessExpire int64, nowSec
|
|||
for i := 0; i < myclaimsType.NumField(); i++ {
|
||||
field := myclaimsType.Field(i)
|
||||
tag := field.Tag.Get("json")
|
||||
if tag == "exp" || tag == "iat" {
|
||||
continue
|
||||
}
|
||||
value := myclaimsValue.Field(i).Interface()
|
||||
// 将字段值赋给 claims 对象的相应键
|
||||
claims[tag] = value
|
||||
|
|
|
@ -19,7 +19,7 @@ func TestCase(t *testing.T) {
|
|||
data, _ := json.Marshal(info)
|
||||
log.Println(string(data))
|
||||
|
||||
a := `{"user_id":0,"guest_id":1,"exp":0, "debug": { "exp": 12321213321}}`
|
||||
a := `{"user_id":0,"guest_id":1,"exp":0, "debug": { "exp": 123212, "is_cache": 1}}`
|
||||
err := json.Unmarshal([]byte(a), info)
|
||||
log.Println(err)
|
||||
log.Printf("%#v %v", info, info.Debug)
|
||||
|
|
Loading…
Reference in New Issue
Block a user