master
huanghai 5 years ago
parent 59e603062a
commit 90605a74b5

@ -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,

@ -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)",

@ -7,7 +7,7 @@
"license": {},
"version": "2.0"
},
"host": "10.10.14.187:8000",
"host": "127.0.0.1:8000",
"paths": {
"/oauth2/AddClient": {
"get": {

@ -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

@ -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)

Loading…
Cancel
Save