feat: add jwt
This commit is contained in:
@@ -49,10 +49,27 @@ func GinRecovery(stack bool) gin.HandlerFunc {
|
||||
}
|
||||
utils.RequestLogError(logParams...)
|
||||
c.AbortWithStatus(http.StatusInternalServerError)
|
||||
fmt.Println(err)
|
||||
fmt.Printf("\n%s\n", debug.Stack())
|
||||
fmt.Printf("\n%s\n", err)
|
||||
fmt.Printf("\n%s\n", cutStack(debug.Stack()))
|
||||
}
|
||||
}()
|
||||
c.Next()
|
||||
}
|
||||
}
|
||||
|
||||
func cutStack(stack []byte) string {
|
||||
stackStr := string(stack)
|
||||
line := 0
|
||||
lastLineCharIndex := 0
|
||||
for index, char := range stackStr {
|
||||
if char == '\n' {
|
||||
line++
|
||||
}
|
||||
if line == 7 {
|
||||
lastLineCharIndex = index + 1
|
||||
break
|
||||
}
|
||||
}
|
||||
fmt.Println(stackStr[lastLineCharIndex:])
|
||||
return ""
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user