feat: add jwt

This commit is contained in:
fallen-angle
2022-02-10 17:08:42 +08:00
parent 77f7d0caad
commit 2d43931fc8
10 changed files with 165 additions and 5 deletions

View File

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