作者 yangfu

修改手机号

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