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) authGroup.POST("forgetPwd", authController.ForgetPwd) authTokenController := new(controller.AuthController) authTokenGroup := baseGroup.Group("auth/").Use(middleware.Token()) authTokenGroup.POST("modifyPwd", authTokenController.ModifyPwd) authTokenGroup.POST("bindMobile", authTokenController.BindMobile) authTokenGroup.POST("modifyMobile", authTokenController.ModifyMobile) }