mirror of
https://gitee.com/dromara/mayfly-go
synced 2025-12-27 18:06:37 +08:00
wip: oauth2登录和oauth2 otp登录验证
This commit is contained in:
@@ -2,6 +2,7 @@ package router
|
||||
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
msgapp "mayfly-go/internal/msg/application"
|
||||
"mayfly-go/internal/sys/api"
|
||||
"mayfly-go/internal/sys/application"
|
||||
"mayfly-go/pkg/req"
|
||||
@@ -9,7 +10,10 @@ import (
|
||||
|
||||
func InitSysAuthRouter(router *gin.RouterGroup) {
|
||||
r := &api.Auth{
|
||||
ConfigApp: application.GetConfigApp(),
|
||||
ConfigApp: application.GetConfigApp(),
|
||||
AuthApp: application.GetAuthApp(),
|
||||
AccountApp: application.GetAccountApp(),
|
||||
MsgApp: msgapp.GetMsgApp(),
|
||||
}
|
||||
rg := router.Group("sys/auth")
|
||||
|
||||
@@ -17,7 +21,11 @@ func InitSysAuthRouter(router *gin.RouterGroup) {
|
||||
|
||||
reqs := [...]*req.Conf{
|
||||
req.NewGet("", r.GetInfo).RequiredPermission(baseP),
|
||||
|
||||
req.NewPut("/oauth2", r.SaveOAuth2).RequiredPermission(baseP),
|
||||
|
||||
req.NewGet("/oauth2/login", r.OAuth2Login).DontNeedToken(),
|
||||
req.NewGet("/oauth2/callback", r.OAuth2Callback).NoRes().DontNeedToken(),
|
||||
}
|
||||
|
||||
req.BatchSetGroup(rg, reqs[:])
|
||||
|
||||
Reference in New Issue
Block a user