1
0
mirror of https://github.com/IceWhaleTech/CasaOS.git synced 2025-07-12 23:50:14 +02:00
* switch branches

* update user interface

* switch branch

* switch branch

* change branch

* submit 0.3.3
This commit is contained in:
link
2022-06-29 11:09:58 +08:00
committed by GitHub
parent b0dc30277b
commit f99f49dd7e
127 changed files with 5751 additions and 7533 deletions

View File

@ -2,7 +2,7 @@
* @Author: LinkLeong link@icewhale.com
* @Date: 2021-10-08 10:29:08
* @LastEditors: LinkLeong
* @LastEditTime: 2022-05-25 19:17:45
* @LastEditTime: 2022-06-21 15:10:03
* @FilePath: /CasaOS/middleware/gin.go
* @Description:
* @Website: https://www.casaos.io
@ -14,7 +14,9 @@ import (
"fmt"
"net/http"
"github.com/IceWhaleTech/CasaOS/pkg/utils/loger"
"github.com/gin-gonic/gin"
"go.uber.org/zap"
)
func Cors() gin.HandlerFunc {
@ -48,3 +50,9 @@ func Cors() gin.HandlerFunc {
c.Next()
}
}
func WriteLog() gin.HandlerFunc {
return func(c *gin.Context) {
loger.Info("request:", zap.Any("path", c.Request.URL.String()), zap.Any("param", c.Params), zap.Any("query", c.Request.URL.Query()), zap.Any("body", c.Request.Body), zap.Any("method", c.Request.Method))
c.Next()
}
}