|
|
|
@ -81,8 +81,6 @@ func getCaptcha(c *gin.Context) {
|
|
|
|
|
// @X-LengthLimit [{"captchaId":"20,20"}]
|
|
|
|
|
func getCaptchaPng(c *gin.Context) {
|
|
|
|
|
ControllerRecaptcha.ServeHTTP(c.Writer, c.Request)
|
|
|
|
|
var captchaId=c.Query("captchaId")
|
|
|
|
|
ControllerRecaptcha.Serve(c.Writer,c.Request,captchaId,400,200)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -210,15 +208,11 @@ func accessToken(context *gin.Context) {
|
|
|
|
|
k := ConfigUtil.OAuth2RedisKeyPrefix + ":refresh_token_vs_person:" + refreshToken
|
|
|
|
|
RedisUtil.SET(k, personStr, time.Hour*24*30) //30天的有效期
|
|
|
|
|
|
|
|
|
|
//扩展一下bureau_id(旧版本专用)
|
|
|
|
|
var bureauId =ServiceLoginPerson.GetPersonBureauById(identityId, personId)
|
|
|
|
|
|
|
|
|
|
//返回json数据
|
|
|
|
|
context.JSON(http.StatusOK,
|
|
|
|
|
gin.H{
|
|
|
|
|
"access_token": accessToken, "expires_in": expiresIn, "refresh_token": refreshToken,
|
|
|
|
|
"token_type": tokenType, "identity_id": identityIdInt, "person_id": personId, "bureau_id": bureauId,
|
|
|
|
|
})
|
|
|
|
|
"token_type": tokenType, "identity_id": identityIdInt, "person_id": personId})
|
|
|
|
|
return
|
|
|
|
|
} else {
|
|
|
|
|
//刷新token
|
|
|
|
@ -257,14 +251,11 @@ func accessToken(context *gin.Context) {
|
|
|
|
|
personIdInt, _ := strconv.Atoi(personId)
|
|
|
|
|
//删除旧的refresh_token
|
|
|
|
|
RedisUtil.DEL(key)
|
|
|
|
|
//扩展一下bureau_id(旧版本专用)
|
|
|
|
|
var bureauId =ServiceLoginPerson.GetPersonBureauById(identityId, personId)
|
|
|
|
|
//返回json数据
|
|
|
|
|
context.JSON(http.StatusOK,
|
|
|
|
|
gin.H{
|
|
|
|
|
"access_token": accessToken, "expires_in": expiresIn, "refresh_token": refreshToken,
|
|
|
|
|
"token_type": tokenType, "identity_id": identityIdInt, "person_id": personIdInt, "bureau_id": bureauId,
|
|
|
|
|
})
|
|
|
|
|
"token_type": tokenType, "identity_id": identityIdInt, "person_id": personIdInt})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|