diff --git a/dsSso/Controller/ControllerOauth2/ControllerOauth2.go b/dsSso/Controller/ControllerOauth2/ControllerOauth2.go index b2ef3517..aad411f0 100644 --- a/dsSso/Controller/ControllerOauth2/ControllerOauth2.go +++ b/dsSso/Controller/ControllerOauth2/ControllerOauth2.go @@ -743,11 +743,11 @@ func unBindWxUser(context *gin.Context) { // @Tags 统一认证管理 // @Accept application/x-www-form-urlencoded // @Produce json -// @Param access_key query string true "access_key" -// @Param secret_key query string true "secret_key" -// @Param redirect_uri query string true "redirect_uri" +// @Param access_key formData string true "access_key" +// @Param secret_key formData string true "secret_key" +// @Param redirect_uri formData string true "redirect_uri" // @Success 200 {string} string -// @Router /oauth2/AddClient [get] +// @Router /oauth2/AddClient [post] func AddClient(context *gin.Context) { ip := context.ClientIP() if ip != "127.0.0.1" { @@ -757,9 +757,9 @@ func AddClient(context *gin.Context) { }) return } - accessKey := context.Query("access_key") - secretKey := context.Query("secret_key") - redirectUri := context.Query("redirect_uri") + accessKey := context.PostForm("access_key") + secretKey := context.PostForm("secret_key") + redirectUri := context.PostForm("redirect_uri") RedisStorage.OAuth2RedisStorage.CreateClient( &osin.DefaultClient{ Id: accessKey, @@ -778,9 +778,9 @@ func AddClient(context *gin.Context) { // @Tags 统一认证管理 // @Accept application/x-www-form-urlencoded // @Produce json -// @Param access_key query string true "access_key" +// @Param access_key formData string true "access_key" // @Success 200 {string} string -// @Router /oauth2/DelClient [get] +// @Router /oauth2/DelClient [post] func DelClient(context *gin.Context) { ip := context.ClientIP() if ip != "127.0.0.1" { @@ -790,7 +790,7 @@ func DelClient(context *gin.Context) { }) return } - accessKey := context.Query("access_key") + accessKey := context.PostForm("access_key") RedisStorage.OAuth2RedisStorage.DeleteClient( &osin.DefaultClient{ Id: accessKey, diff --git a/dsSso/docs/docs.go b/dsSso/docs/docs.go index 3d5a1f0d..1e1384d5 100644 --- a/dsSso/docs/docs.go +++ b/dsSso/docs/docs.go @@ -664,7 +664,7 @@ type swaggerInfo struct { // SwaggerInfo holds exported Swagger Info so clients can modify it var SwaggerInfo = swaggerInfo{ Version: "2.0", - Host: "10.10.14.187:8000", + Host: "127.0.0.1:8000", BasePath: "", Schemes: []string{}, Title: "东师理想统一认证中心(OAuth2+Sso)", diff --git a/dsSso/docs/swagger.json b/dsSso/docs/swagger.json index 970f0eb0..55595a19 100644 --- a/dsSso/docs/swagger.json +++ b/dsSso/docs/swagger.json @@ -7,7 +7,7 @@ "license": {}, "version": "2.0" }, - "host": "10.10.14.187:8000", + "host": "127.0.0.1:8000", "paths": { "/oauth2/AddClient": { "get": { diff --git a/dsSso/docs/swagger.yaml b/dsSso/docs/swagger.yaml index af922bfb..cab20acc 100644 --- a/dsSso/docs/swagger.yaml +++ b/dsSso/docs/swagger.yaml @@ -32,7 +32,7 @@ definitions: description: 个数 type: object type: object -host: 10.10.14.187:8000 +host: 127.0.0.1:8000 info: contact: {} description: 参考自xxl-sso diff --git a/dsSso/main.go b/dsSso/main.go index b514a25e..92e8a73d 100644 --- a/dsSso/main.go +++ b/dsSso/main.go @@ -56,7 +56,7 @@ func startOAuth2Server() { // @title 东师理想统一认证中心(OAuth2+Sso) // @version 2.0 // @description 参考自xxl-sso -// @host 10.10.14.187:8000 +// @host 127.0.0.1:8000 func main() { // 发布模式 //gin.SetMode(gin.ReleaseMode)