update qq/gitee/github oauth2 login

This commit is contained in:
landaiqing
2024-08-24 16:31:40 +08:00
parent 014abca8f8
commit 9330935822
45 changed files with 1243 additions and 642 deletions

View File

@@ -14,8 +14,8 @@ func OauthRouter(router *gin.RouterGroup) {
{
wechatRouter.GET("/generate_client_id", oauth.GenerateClientId)
wechatRouter.GET("/get_temp_qrcode", oauth.GetTempQrCode)
wechatRouter.GET("/callback", oauth.CallbackVerify)
//wechatRouter.POST("/callback", oauth.CallbackNotify)
//wechatRouter.GET("/callback", oauth.CallbackVerify)
wechatRouter.POST("/callback", oauth.CallbackNotify)
}
githubRouter := group.Group("/github")
{

View File

@@ -0,0 +1,16 @@
package modules
import (
"github.com/gin-gonic/gin"
"schisandra-cloud-album/api"
"schisandra-cloud-album/middleware"
)
var roleApi = api.Api.RoleApi
func RoleRouter(router *gin.RouterGroup) {
group := router.Group("/auth")
group.Use(middleware.JWTAuthMiddleware())
group.POST("/role/create", roleApi.CreateRole)
group.POST("/role/add_role_to_user", roleApi.AddRoleToUser)
}