|
|
|
@ -36,6 +36,9 @@ func Routers(r *gin.RouterGroup) {
|
|
|
|
|
r.GET("/getCaptcha", getCaptcha)
|
|
|
|
|
//获取验证码图片
|
|
|
|
|
r.GET("/getCaptchaPng", getCaptchaPng)
|
|
|
|
|
//退出接口
|
|
|
|
|
r.GET("/logout", logout)
|
|
|
|
|
r.POST("/logout", logout)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -392,3 +395,16 @@ func authorizeGet(context *gin.Context) {
|
|
|
|
|
url := "/sso/static/index.html?redirect_uri=" + redirectUri + "&response_type=code&client_id=" + paraClientId + "&oauth_callback=" + oauthCallback
|
|
|
|
|
context.Redirect(302, url)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// @Summary 退出统一认证
|
|
|
|
|
// @Description 退出统一认证
|
|
|
|
|
// @Tags 登录验证类
|
|
|
|
|
// @Accept application/x-www-form-urlencoded
|
|
|
|
|
// @Produce json
|
|
|
|
|
// @Success 200 {string} string
|
|
|
|
|
// @Router /oauth2/logout [get]
|
|
|
|
|
func logout(context *gin.Context) {
|
|
|
|
|
SsoUtil.DeleteSsoCookie(context)
|
|
|
|
|
msg := "统一认证退出成功!"
|
|
|
|
|
context.JSON(http.StatusOK, map[string]interface{}{"success": false, "msg": msg})
|
|
|
|
|
}
|
|
|
|
|