✨ scan the QR code to log in on the WeChat public account
This commit is contained in:
16
router/modules/oauth_router.go
Normal file
16
router/modules/oauth_router.go
Normal file
@@ -0,0 +1,16 @@
|
||||
package modules
|
||||
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
"schisandra-cloud-album/api"
|
||||
)
|
||||
|
||||
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)
|
||||
}
|
@@ -14,6 +14,8 @@ func UserRouter(router *gin.RouterGroup) {
|
||||
{
|
||||
userGroup.POST("/login", userApi.AccountLogin)
|
||||
userGroup.POST("/phone_login", userApi.PhoneLogin)
|
||||
userGroup.POST("/add", userApi.AddUser)
|
||||
userGroup.POST("/reset_password", userApi.ResetPassword)
|
||||
}
|
||||
authGroup := router.Group("auth").Use(middleware.JWTAuthMiddleware())
|
||||
{
|
||||
|
@@ -26,5 +26,6 @@ func InitRouter() *gin.Engine {
|
||||
modules.UserRouter(publicGroup) // 注册鉴权路由
|
||||
modules.CaptchaRouter(publicGroup) // 注册验证码路由
|
||||
modules.SmsRouter(publicGroup) // 注册短信验证码路由
|
||||
modules.OauthRouter(publicGroup) // 注册oauth路由
|
||||
return router
|
||||
}
|
||||
|
Reference in New Issue
Block a user