1
This commit is contained in:
parent
df6798dad1
commit
1f0622ac64
@ -62,6 +62,13 @@ func JwtAuth(c *gin.Context) {
|
||||
}
|
||||
rspObj.ErrCode = q5.SafeToInt32(jsonRspObj.ErrCode)
|
||||
rspObj.ErrMsg = jsonRspObj.ErrMsg
|
||||
if rspObj.ErrCode != 0 {
|
||||
rspObj.ErrCode = 501
|
||||
rspObj.ErrMsg = "jwt error"
|
||||
c.JSON(200, rspObj)
|
||||
c.Abort()
|
||||
return
|
||||
}
|
||||
c.Set("open_id", jsonRspObj.Decoded.Sub)
|
||||
c.Next()
|
||||
})
|
||||
|
@ -9,8 +9,9 @@ type ShopCartRouter struct{}
|
||||
|
||||
func (this *ShopCartRouter) InitRouter() {
|
||||
api := v1.ApiGroupApp.ShopCartApiGroup
|
||||
f5.GetApp().GetGinEngine().GET("/api/shopcart/list", api.ShopCartApi.List)
|
||||
f5.GetApp().GetGinEngine().POST("/api/shopcart/add", api.ShopCartApi.Add)
|
||||
f5.GetApp().GetGinEngine().POST("/api/shopcart/del", api.ShopCartApi.Del)
|
||||
f5.GetApp().GetGinEngine().POST("/api/shopcart/clear", api.ShopCartApi.Clear)
|
||||
shopCartGroup := f5.GetApp().GetGinEngine().Group("/api/shopcart")
|
||||
shopCartGroup.GET("/list", api.ShopCartApi.List)
|
||||
shopCartGroup.POST("/add", api.ShopCartApi.Add)
|
||||
shopCartGroup.POST("/del", api.ShopCartApi.Del)
|
||||
shopCartGroup.POST("/clear", api.ShopCartApi.Clear)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user