添加jwt请求验证功能

This commit is contained in:
2025-08-10 20:34:58 +08:00
parent f41a1a02d6
commit d490ecb405
5 changed files with 16 additions and 1 deletions

View File

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