取消token验证

This commit is contained in:
wuchao 2024-06-27 17:59:02 +08:00
parent 3fa9353e56
commit 4741443bcf
2 changed files with 14 additions and 15 deletions

View File

@ -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

View File

@ -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")
{