添加jwt请求验证功能
This commit is contained in:
@@ -2,8 +2,10 @@ package router
|
||||
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
"toutoukan/controllers/test"
|
||||
"toutoukan/controllers/user"
|
||||
"toutoukan/socket"
|
||||
"toutoukan/utill"
|
||||
)
|
||||
|
||||
func SetupRouter() *gin.Engine {
|
||||
@@ -12,6 +14,7 @@ func SetupRouter() *gin.Engine {
|
||||
apiGroup := r.Group("/user")
|
||||
{
|
||||
apiGroup.POST("/login", user.UserLogin)
|
||||
apiGroup.POST("/test", utill.JWTAuthMiddleware(), test.Testjwt)
|
||||
}
|
||||
r.GET("/socket", func(c *gin.Context) {
|
||||
socket.WebsocketHandler(c)
|
||||
|
||||
Reference in New Issue
Block a user