You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
839 B
32 lines
839 B
package SSOAccountController
|
|
|
|
import (
|
|
"dsSupport/MyModel/SSOAccount/SSOAccountOpenAPI"
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
func Routers(r *gin.RouterGroup) {
|
|
rr := r.Group("/ssoAccount")
|
|
|
|
{
|
|
rr.POST("/login", SSOAccountOpenAPI.Login)
|
|
rr.OPTIONS("/login", HandleOptions)
|
|
rr.POST("/logout", SSOAccountOpenAPI.Logout)
|
|
rr.GET("/logout", SSOAccountOpenAPI.Logout)
|
|
rr.OPTIONS("/logout", HandleOptions)
|
|
rr.POST("/userInfo", SSOAccountOpenAPI.UserInfo)
|
|
rr.GET("/userInfo", SSOAccountOpenAPI.UserInfo)
|
|
rr.OPTIONS("/userInfo", HandleOptions)
|
|
}
|
|
|
|
return
|
|
}
|
|
|
|
func HandleOptions(c *gin.Context) {
|
|
c.Header("Access-Control-Allow-Origin", "*")
|
|
c.Header("Access-Control-Allow-Methods", "POST, GET, OPTIONS")
|
|
c.Header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept, Authorization")
|
|
|
|
c.String(200, "ok")
|
|
}
|