go-wxhelper/router/admin/login.go

19 lines
635 B
Go
Raw Normal View History

2024-01-19 12:06:30 +08:00
package admin
import (
"github.com/gin-gonic/gin"
loginApi "wechat-robot/api/admin/login"
"wechat-robot/router/middleware"
)
// 登录相关
func login(g *gin.RouterGroup) {
cg := g.Group("/captcha") // 验证码相关接口
cg.GET("/img", loginApi.GetImgCaptcha) // 获取图形验证码
t := g.Group("/token") // 登录相关接口
t.POST("", loginApi.Login) // 登录
t.POST("/refresh", loginApi.Refresh) // 刷新Token
t.POST("/logout", middleware.AuthorizeToken(), loginApi.Logout) // 退出登录
}