github oauth2 login /gitee oauth2 login

This commit is contained in:
landaiqing
2024-08-19 00:14:01 +08:00
parent 57964d39af
commit 08b2790bee
23 changed files with 783 additions and 138 deletions

View File

@@ -9,8 +9,22 @@ var oauth = api.Api.OAuthApi
func OauthRouter(router *gin.RouterGroup) {
group := router.Group("/oauth")
group.GET("/generate_client_id", oauth.GenerateClientId)
group.GET("/get_temp_qrcode", oauth.GetTempQrCode)
//group.GET("/callback", oauth.CallbackVerify)
group.POST("/callback", oauth.CallbackNotify)
{
group.GET("/generate_client_id", oauth.GenerateClientId)
group.GET("/get_temp_qrcode", oauth.GetTempQrCode)
//group.GET("/callback", oauth.CallbackVerify)
group.POST("/callback", oauth.CallbackNotify)
githubRouter := group.Group("/github")
{
githubRouter.GET("/get_url", oauth.GetRedirectUrl)
githubRouter.GET("/callback", oauth.Callback)
}
giteeRouter := group.Group("/gitee")
{
giteeRouter.GET("/get_url", oauth.GetGiteeRedirectUrl)
giteeRouter.GET("/callback", oauth.GiteeCallback)
}
}
}