2022-08-16 23:30:23 +08:00
|
|
|
package router
|
|
|
|
|
|
|
|
import (
|
2022-10-17 16:32:31 +08:00
|
|
|
v1 "github.com/1Panel-dev/1Panel/backend/app/api/v1"
|
|
|
|
"github.com/1Panel-dev/1Panel/backend/middleware"
|
2022-08-16 23:30:23 +08:00
|
|
|
"github.com/gin-gonic/gin"
|
|
|
|
)
|
|
|
|
|
|
|
|
type BaseRouter struct{}
|
|
|
|
|
2022-08-29 18:10:37 +08:00
|
|
|
func (s *BaseRouter) InitBaseRouter(Router *gin.RouterGroup) {
|
2022-08-16 23:30:23 +08:00
|
|
|
baseRouter := Router.Group("auth")
|
2022-08-29 18:10:37 +08:00
|
|
|
withRecordRouter := Router.Group("auth").Use(middleware.OperationRecord())
|
2022-08-16 23:30:23 +08:00
|
|
|
baseApi := v1.ApiGroupApp.BaseApi
|
|
|
|
{
|
2022-08-29 18:10:37 +08:00
|
|
|
baseRouter.GET("captcha", baseApi.Captcha)
|
2022-09-15 18:43:41 +08:00
|
|
|
baseRouter.POST("mfalogin", baseApi.MFALogin)
|
2022-08-16 23:30:23 +08:00
|
|
|
withRecordRouter.POST("login", baseApi.Login)
|
|
|
|
withRecordRouter.POST("logout", baseApi.LogOut)
|
|
|
|
}
|
|
|
|
}
|