取消token验证
This commit is contained in:
parent
3fa9353e56
commit
4741443bcf
|
@ -13,11 +13,9 @@ import (
|
||||||
zh_translations "gopkg.in/go-playground/validator.v9/translations/zh"
|
zh_translations "gopkg.in/go-playground/validator.v9/translations/zh"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"qteam/app/constants/errorcode"
|
||||||
"qteam/app/utils"
|
"qteam/app/utils"
|
||||||
"qteam/config"
|
"qteam/config"
|
||||||
"strconv"
|
|
||||||
|
|
||||||
"qteam/app/constants/errorcode"
|
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
)
|
)
|
||||||
|
@ -178,16 +176,17 @@ func Frequence(key string) bool {
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetUserId(c *gin.Context) int {
|
func GetUserId(c *gin.Context) int {
|
||||||
userIdStr, _ := c.Get("userId")
|
return 2
|
||||||
if userIdStr != nil {
|
//userIdStr, _ := c.Get("userId")
|
||||||
var userId, _ = userIdStr.(string)
|
//if userIdStr != nil {
|
||||||
atoi, err := strconv.Atoi(userId)
|
// var userId, _ = userIdStr.(string)
|
||||||
if err != nil {
|
// atoi, err := strconv.Atoi(userId)
|
||||||
return 0
|
// if err != nil {
|
||||||
}
|
// return 0
|
||||||
return atoi
|
// }
|
||||||
}
|
// return atoi
|
||||||
return 0
|
//}
|
||||||
|
//return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetUserCustNo 获取用户custNo
|
// GetUserCustNo 获取用户custNo
|
||||||
|
|
|
@ -58,8 +58,8 @@ func RegisterRoute(router *gin.Engine) {
|
||||||
v1.POST("/product/detail", front.ProductDetail)
|
v1.POST("/product/detail", front.ProductDetail)
|
||||||
|
|
||||||
//auth
|
//auth
|
||||||
//auth := v1.Group("auth")
|
auth := v1.Group("auth")
|
||||||
auth := v1.Group("auth", middlewares.Auth())
|
//auth := v1.Group("auth", middlewares.Auth())
|
||||||
{
|
{
|
||||||
order := auth.Group("/order")
|
order := auth.Group("/order")
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue