permission.go 400 B

12345678910111213141516171819
  1. package router
  2. type CheckType int
  3. const (
  4. AuthCheckLogin CheckType = 1
  5. )
  6. // func AddAuthCheck(handlerFunc gin.HandlerFunc, checkType CheckType) gin.HandlerFunc {
  7. // return func(c *gin.Context) {
  8. // ctx := service.GetContextPtr(c)
  9. // if ctx == nil || ctx.UserID == -1 {
  10. // web.FailedResponse(c, trans.TR(true, trans.PermissionNotValid))
  11. // return
  12. // }
  13. // handlerFunc(c)
  14. // }
  15. // }