作者 yangfu

修改手机号

@@ -92,7 +92,8 @@ func ChangePhone(header *protocol.RequestHeader, request *protocol.ChangePhoneRe @@ -92,7 +92,8 @@ func ChangePhone(header *protocol.RequestHeader, request *protocol.ChangePhoneRe
92 err = protocol.NewErrWithMessage(502, err) //账号不存在 92 err = protocol.NewErrWithMessage(502, err) //账号不存在
93 return 93 return
94 } 94 }
95 - if partnerInfo, err = PartnerInfoService.FindOne(map[string]interface{}{"account": request.Phone}); err == nil { 95 + //验证新手机是否已经存在
  96 + if _, e := PartnerInfoService.FindOne(map[string]interface{}{"account": request.Phone}); e == nil {
96 err = protocol.NewErrWithMessage(2029, err) //账号已存在 97 err = protocol.NewErrWithMessage(2029, err) //账号已存在
97 return 98 return
98 } 99 }
@@ -81,7 +81,6 @@ func (this *UserController) ChangePhone() { @@ -81,7 +81,6 @@ func (this *UserController) ChangePhone() {
81 return 81 return
82 } 82 }
83 header := this.GetRequestHeader(this.Ctx) 83 header := this.GetRequestHeader(this.Ctx)
84 - msg = protocol.NewReturnResponse(user.ChangePhone(header, request))  
85 data, err := user.ChangePhone(header, request) 84 data, err := user.ChangePhone(header, request)
86 if err == nil { 85 if err == nil {
87 msg = protocol.NewResponseMessage(0, "修改手机号成功") 86 msg = protocol.NewResponseMessage(0, "修改手机号成功")