fix: 优化代码

This commit is contained in:
tbphp
2025-06-09 22:03:15 +08:00
parent 0c5cf4266d
commit 9562f0f6dd
5 changed files with 48 additions and 46 deletions

View File

@@ -173,7 +173,7 @@ func Auth(config types.AuthConfig) gin.HandlerFunc {
// Recovery creates a recovery middleware with custom error handling
func Recovery() gin.HandlerFunc {
return gin.CustomRecovery(func(c *gin.Context, recovered interface{}) {
return gin.CustomRecovery(func(c *gin.Context, recovered any) {
if err, ok := recovered.(string); ok {
logrus.Errorf("Panic recovered: %s", err)
c.JSON(500, gin.H{