Documentation ¶
Index ¶
- Constants
- Variables
- func AuthCheckRole() gin.HandlerFunc
- func AuthInit() (*jwt.GinJWTMiddleware, error)
- func CustomError(c *gin.Context)
- func InitMiddleware(r *gin.Engine)
- func LoggerToFile() gin.HandlerFunc
- func NoCache(c *gin.Context)
- func Options(c *gin.Context)
- func RequestId(trafficKey string) gin.HandlerFunc
- func Secure(c *gin.Context)
- func Sentinel() gin.HandlerFunc
- func SetDBOperLog(c *gin.Context, clientIP string, statusCode int, reqUri string, ...)
- func Trace() gin.HandlerFunc
- func WithContextDb(c *gin.Context)
- type UrlInfo
Constants ¶
View Source
const ( JwtTokenCheck string = "JwtToken" RoleCheck string = "AuthCheckRole" PermissionCheck string = "PermissionAction" )
Variables ¶
View Source
var CasbinExclude = []UrlInfo{
{Url: "/api/v1/dict/type-option-select", Method: "GET"},
{Url: "/api/v1/dict-data/option-select", Method: "GET"},
{Url: "/api/v1/deptTree", Method: "GET"},
{Url: "/api/v1/db/tables/page", Method: "GET"},
{Url: "/api/v1/db/columns/page", Method: "GET"},
{Url: "/api/v1/gen/toproject/:tableId", Method: "GET"},
{Url: "/api/v1/gen/todb/:tableId", Method: "GET"},
{Url: "/api/v1/gen/tabletree", Method: "GET"},
{Url: "/api/v1/gen/preview/:tableId", Method: "GET"},
{Url: "/api/v1/gen/apitofile/:tableId", Method: "GET"},
{Url: "/api/v1/getCaptcha", Method: "GET"},
{Url: "/api/v1/getinfo", Method: "GET"},
{Url: "/api/v1/menuTreeselect", Method: "GET"},
{Url: "/api/v1/menurole", Method: "GET"},
{Url: "/api/v1/menuids", Method: "GET"},
{Url: "/api/v1/roleMenuTreeselect/:roleId", Method: "GET"},
{Url: "/api/v1/roleDeptTreeselect/:roleId", Method: "GET"},
{Url: "/api/v1/refresh_token", Method: "GET"},
{Url: "/api/v1/configKey/:configKey", Method: "GET"},
{Url: "/api/v1/app-config", Method: "GET"},
{Url: "/api/v1/user/profile", Method: "GET"},
{Url: "/info", Method: "GET"},
{Url: "/api/v1/login", Method: "POST"},
{Url: "/api/v1/logout", Method: "POST"},
{Url: "/api/v1/user/avatar", Method: "POST"},
{Url: "/api/v1/user/pwd", Method: "PUT"},
{Url: "/api/v1/metrics", Method: "GET"},
{Url: "/api/v1/health", Method: "GET"},
{Url: "/", Method: "GET"},
{Url: "/api/v1/server-monitor", Method: "GET"},
{Url: "/api/v1/server-ver", Method: "GET"},
{Url: "/api/v1/public/uploadFile", Method: "POST"},
{Url: "/api/v1/user/pwd/set", Method: "PUT"},
{Url: "/api/v1/sys-user", Method: "PUT"},
}
CasbinExclude casbin 排除的路由列表
Functions ¶
func CustomError ¶
func InitMiddleware ¶
func NoCache ¶
NoCache is a middleware function that appends headers to prevent the client from caching the HTTP response.
func Options ¶
Options is a middleware function that appends headers for options requests and aborts then exits the middleware chain and ends the request.
func SetDBOperLog ¶
func SetDBOperLog(c *gin.Context, clientIP string, statusCode int, reqUri string, reqMethod string, latencyTime time.Duration, body string, result string, status int)
SetDBOperLog 写入操作日志表 fixme 该方法后续即将弃用
func WithContextDb ¶
Types ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.