123456789101112131415161718192021 |
- package routers
- import (
- "github.com/gin-gonic/gin"
- "hongze/hongze_yb_en_api/controller"
- "hongze/hongze_yb_en_api/middleware"
- )
- func InitAuth(baseGroup *gin.RouterGroup) {
- //登录
- authController := new(controller.AuthController)
- authGroup := baseGroup.Group("auth/")
- authGroup.POST("login", authController.Login)
- authGroup.POST("register", authController.Register)
- authGroup.GET("smsCode", authController.GetSmsCode)
- authGroup.GET("emailCode", authController.GetEmailCode)
- authTokenController := new(controller.AuthController)
- authTokenGroup := baseGroup.Group("auth/").Use(middleware.Token())
- authTokenGroup.POST("modifyPwd", authTokenController.ModifyPwd).Use(middleware.Token())
- }
|