...
|
...
|
@@ -113,10 +113,10 @@ func ChangePhone(header *protocol.RequestHeader, request *protocol.ChangePhoneRe |
|
|
//重置密码
|
|
|
func ResetPassword(header *protocol.RequestHeader, request *protocol.ResetPasswordRequest) (rsp *protocol.ResetPasswordResponse, err error) {
|
|
|
var (
|
|
|
PartnerInfoService = service.NewPartnerInfoService(nil)
|
|
|
partnerInfo *domain.PartnerInfo
|
|
|
transactionContext, _ = factory.CreateTransactionContext(nil)
|
|
|
PartnerInfoDao, _ = factory.CreatePartnerInfoDao(transactionContext)
|
|
|
PartnerInfoService, _ = factory.CreatePartnerInfoRepositoryIn(transactionContext)
|
|
|
)
|
|
|
rsp = &protocol.ResetPasswordResponse{}
|
|
|
if err = transactionContext.StartTransaction(); err != nil {
|
...
|
...
|
@@ -133,14 +133,10 @@ func ResetPassword(header *protocol.RequestHeader, request *protocol.ResetPasswo |
|
|
err = protocol.NewErrWithMessage(2026)
|
|
|
return
|
|
|
}
|
|
|
if partnerInfo, err = PartnerInfoService.GetPartnerInfo(&query.GetPartnerInfoQuery{Id: int(header.UserId)}); err != nil {
|
|
|
if partnerInfo, err = PartnerInfoService.FindOne(map[string]interface{}{"id": header.UserId}); err != nil {
|
|
|
err = protocol.NewErrWithMessage(502, err) //账号不存在
|
|
|
return
|
|
|
}
|
|
|
//if _, err = auth.CheckSmsCode(partnerInfo.Account, request.Captcha); err != nil {
|
|
|
// log.Error(err)
|
|
|
// return
|
|
|
//}
|
|
|
if err = PartnerInfoDao.Update(map[string]interface{}{
|
|
|
"Id": partnerInfo.Id,
|
|
|
"Password": request.ConfirmPwd,
|
...
|
...
|
@@ -154,10 +150,10 @@ func ResetPassword(header *protocol.RequestHeader, request *protocol.ResetPasswo |
|
|
//修改密码
|
|
|
func ChangePassword(header *protocol.RequestHeader, request *protocol.ChangePasswordRequest) (rsp *protocol.ChangePasswordResponse, err error) {
|
|
|
var (
|
|
|
PartnerInfoService = service.NewPartnerInfoService(nil)
|
|
|
partnerInfo *domain.PartnerInfo
|
|
|
transactionContext, _ = factory.CreateTransactionContext(nil)
|
|
|
PartnerInfoDao, _ = factory.CreatePartnerInfoDao(transactionContext)
|
|
|
PartnerInfoService, _ = factory.CreatePartnerInfoRepositoryIn(transactionContext)
|
|
|
)
|
|
|
if err = transactionContext.StartTransaction(); err != nil {
|
|
|
return nil, err
|
...
|
...
|
@@ -178,7 +174,7 @@ func ChangePassword(header *protocol.RequestHeader, request *protocol.ChangePass |
|
|
err = protocol.NewErrWithMessage(2027)
|
|
|
return
|
|
|
}
|
|
|
if partnerInfo, err = PartnerInfoService.GetPartnerInfo(&query.GetPartnerInfoQuery{Id: int(header.UserId)}); err != nil {
|
|
|
if partnerInfo, err = PartnerInfoService.FindOne(map[string]interface{}{"id": header.UserId}); err != nil {
|
|
|
err = protocol.NewErrWithMessage(502, err) //账号不存在
|
|
|
return
|
|
|
}
|
...
|
...
|
|