|
|
|
@ -679,13 +679,13 @@ func checkOpenId(context *gin.Context) {
|
|
|
|
|
// @Produce json
|
|
|
|
|
// @Param username formData string true "username"
|
|
|
|
|
// @Param password formData string true "password"
|
|
|
|
|
// @Param openid formData string true "openid"
|
|
|
|
|
// @Param openId formData string true "openId"
|
|
|
|
|
// @Success 200 {string} string
|
|
|
|
|
// @Router /oauth2/bindWxUser [get]
|
|
|
|
|
func bindWxUser(context *gin.Context) {
|
|
|
|
|
username := context.PostForm("username")
|
|
|
|
|
encryptPwd := context.PostForm("password")
|
|
|
|
|
openid := context.PostForm("openid")
|
|
|
|
|
openId := context.PostForm("openId")
|
|
|
|
|
//1、检查用户名与密码是不是匹配
|
|
|
|
|
ip := context.ClientIP()
|
|
|
|
|
b, err := base64.StdEncoding.DecodeString(encryptPwd)
|
|
|
|
@ -709,7 +709,7 @@ func bindWxUser(context *gin.Context) {
|
|
|
|
|
return
|
|
|
|
|
} else {
|
|
|
|
|
//3、进行两者之间的绑定
|
|
|
|
|
_, err := ServiceLoginPerson.BindWxUser(identityId, personId, openid)
|
|
|
|
|
_, err := ServiceLoginPerson.BindWxUser(identityId, personId, openId)
|
|
|
|
|
if err != nil {
|
|
|
|
|
context.JSON(http.StatusOK, Model.Res{
|
|
|
|
|
Code: http.StatusNotImplemented,
|
|
|
|
|