|
|
|
@ -52,6 +52,8 @@ func Routers(r *gin.RouterGroup) {
|
|
|
|
|
r.GET("/checkOpenId", checkOpenId)
|
|
|
|
|
//绑定用户
|
|
|
|
|
r.POST("/bindWxUser", bindWxUser)
|
|
|
|
|
//解除绑定
|
|
|
|
|
r.POST("/unBindWxUser", unBindWxUser)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -705,3 +707,28 @@ func bindWxUser(context *gin.Context) {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// @Summary 解除绑定微信用户
|
|
|
|
|
// @Description 绑定微信用户
|
|
|
|
|
// @Tags 解除登录验证类
|
|
|
|
|
// @Accept application/x-www-form-urlencoded
|
|
|
|
|
// @Produce json
|
|
|
|
|
// @Success 200 {string} string
|
|
|
|
|
// @Router /oauth2/unBindWxUser [get]
|
|
|
|
|
func unBindWxUser(context *gin.Context) {
|
|
|
|
|
identityId, _ := context.Cookie("identity_id")
|
|
|
|
|
personId, _ := context.Cookie("person_id")
|
|
|
|
|
//进行两者之间的解除绑定
|
|
|
|
|
_, err := ServiceLoginPerson.UnBindWxUser(identityId, personId)
|
|
|
|
|
if err != nil {
|
|
|
|
|
context.JSON(http.StatusOK, Model.Res{
|
|
|
|
|
Code: http.StatusNotImplemented,
|
|
|
|
|
Msg: "在执行unBindWxUser函数时出错!",
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
context.JSON(http.StatusOK, Model.Res{
|
|
|
|
|
Code: http.StatusOK,
|
|
|
|
|
Msg: "解除绑定成功!",
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|