diff --git a/app/http/controllers/base.go b/app/http/controllers/base.go index 3c90076..dd3db27 100644 --- a/app/http/controllers/base.go +++ b/app/http/controllers/base.go @@ -13,11 +13,9 @@ import ( zh_translations "gopkg.in/go-playground/validator.v9/translations/zh" "io/ioutil" "net/http" + "qteam/app/constants/errorcode" "qteam/app/utils" "qteam/config" - "strconv" - - "qteam/app/constants/errorcode" "github.com/gin-gonic/gin" ) @@ -178,16 +176,17 @@ func Frequence(key string) bool { } func GetUserId(c *gin.Context) int { - userIdStr, _ := c.Get("userId") - if userIdStr != nil { - var userId, _ = userIdStr.(string) - atoi, err := strconv.Atoi(userId) - if err != nil { - return 0 - } - return atoi - } - return 0 + return 2 + //userIdStr, _ := c.Get("userId") + //if userIdStr != nil { + // var userId, _ = userIdStr.(string) + // atoi, err := strconv.Atoi(userId) + // if err != nil { + // return 0 + // } + // return atoi + //} + //return 0 } // GetUserCustNo 获取用户custNo diff --git a/app/http/routes/route.go b/app/http/routes/route.go index 468d094..e92ca13 100644 --- a/app/http/routes/route.go +++ b/app/http/routes/route.go @@ -58,8 +58,8 @@ func RegisterRoute(router *gin.Engine) { v1.POST("/product/detail", front.ProductDetail) //auth - //auth := v1.Group("auth") - auth := v1.Group("auth", middlewares.Auth()) + auth := v1.Group("auth") + //auth := v1.Group("auth", middlewares.Auth()) { order := auth.Group("/order") {