diff --git a/preprocess.go b/preprocess.go index 7d97dec..9a3762d 100644 --- a/preprocess.go +++ b/preprocess.go @@ -114,7 +114,7 @@ func (p *Preprocess) parseJWT(req *http.Request) { } // 3. 验证jwt凭证是否过期 var v map[string]interface{} - if err = json.Unmarshal(payload, &v); err != nil { + if err = json.Unmarshal(payload, &v); err != nil || v["exp"] == nil { return } exp := int64(math.Floor(v["exp"].(float64)))