forked from lxh/go-wxhelper
19 lines
635 B
Go
19 lines
635 B
Go
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) // 退出登录
|
|
}
|