master
huanghai 5 years ago
parent b992a6fb90
commit 48d9ef24f0

@ -47,7 +47,7 @@ func Routers(r *gin.RouterGroup) {
//清空登录限制
r.GET("/resetRemainCount", resetRemainCount)
//微信登录
r.GET("/wxLogin", wxLogin)
r.POST("/wxLogin", wxLogin)
return
}
@ -495,7 +495,7 @@ func resetRemainCount(context *gin.Context) {
// @X-EmptyLimit ["code"]
// http://10.10.14.187/oauth2/wxLogin?code=??
func wxLogin(context *gin.Context) {
var code = context.Query("code")
var code = context.PostForm("code")
//对接微信腾讯给的AK+SK
appId := "wx3e0449144386938a"
appSecret := "15a37979f34791ca8b920c386afaa0d5"

@ -327,6 +327,41 @@ var doc = `{
]
}
},
"/oauth2/wxLogin": {
"get": {
"description": "微信登录",
"consumes": [
"application/x-www-form-urlencoded"
],
"produces": [
"application/json"
],
"tags": [
"登录验证类"
],
"summary": "微信登录",
"parameters": [
{
"type": "string",
"description": "腾讯返回的code码",
"name": "code",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "string"
}
}
},
"x-emptylimit": [
"code"
]
}
},
"/sso/addJoinApp": {
"post": {
"description": "增加一条接入系统的记录",

@ -311,6 +311,41 @@
]
}
},
"/oauth2/wxLogin": {
"get": {
"description": "微信登录",
"consumes": [
"application/x-www-form-urlencoded"
],
"produces": [
"application/json"
],
"tags": [
"登录验证类"
],
"summary": "微信登录",
"parameters": [
{
"type": "string",
"description": "腾讯返回的code码",
"name": "code",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "string"
}
}
},
"x-emptylimit": [
"code"
]
}
},
"/sso/addJoinApp": {
"post": {
"description": "增加一条接入系统的记录",

@ -242,6 +242,29 @@ paths:
- 登录验证类
x-emptylimit:
- userName
/oauth2/wxLogin:
get:
consumes:
- application/x-www-form-urlencoded
description: 微信登录
parameters:
- description: 腾讯返回的code码
in: query
name: code
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
type: string
summary: 微信登录
tags:
- 登录验证类
x-emptylimit:
- code
/sso/addJoinApp:
post:
consumes:

@ -44,7 +44,7 @@ require (
github.com/swaggo/swag v1.6.5
github.com/syndtr/goleveldb v1.0.0 // indirect
github.com/tealeg/xlsx v1.0.5 // indirect
github.com/tidwall/gjson v1.6.0 // indirect
github.com/tidwall/gjson v1.6.0
github.com/tidwall/pretty v1.0.1 // indirect
github.com/tracer0tong/kafkalogrus v0.0.0-20180816014403-290bb4d4d549
github.com/xormplus/builder v0.0.0-20200331055651-240ff40009be // indirect

Loading…
Cancel
Save