24 lines
702 B
Go
24 lines
702 B
Go
|
package routes
|
||
|
|
||
|
import (
|
||
|
"github.com/eryajf-world/go-ldap-admin/controller"
|
||
|
|
||
|
jwt "github.com/appleboy/gin-jwt/v2"
|
||
|
"github.com/gin-gonic/gin"
|
||
|
)
|
||
|
|
||
|
// 注册基础路由
|
||
|
func InitBaseRoutes(r *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddleware) gin.IRoutes {
|
||
|
base := r.Group("/base")
|
||
|
{
|
||
|
base.GET("ping", controller.Demo)
|
||
|
// 登录登出刷新token无需鉴权
|
||
|
base.POST("/login", authMiddleware.LoginHandler)
|
||
|
base.POST("/logout", authMiddleware.LogoutHandler)
|
||
|
base.POST("/refreshToken", authMiddleware.RefreshHandler)
|
||
|
base.POST("/changePwd", controller.Base.ChangePwd) // 修改用户密码
|
||
|
base.GET("/dashboard", controller.Base.Dashboard) // 系统首页展示数据
|
||
|
}
|
||
|
return r
|
||
|
}
|