...
|
...
|
@@ -52,6 +52,18 @@ func (srv UserService) CheckSmsCode(smsCodeCommand *command.CheckSmsCodeCommand) |
|
|
//ChangePassword 修改密码
|
|
|
func (srv UserService) ChangePassword(changePasswordCommand *command.ChangePasswordCommand) (interface{}, error) {
|
|
|
smsServeGateway := sms_serve.NewHttplibHttplibSmsServe()
|
|
|
if len(changePasswordCommand.OldPassword) > 0 {
|
|
|
// 2.重置密码
|
|
|
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(domain.Operator{})
|
|
|
_, err := creationUserGateway.AuthChangePassword(allied_creation_user.ReqAuthChangePassword{
|
|
|
OldPassword: changePasswordCommand.OldPassword,
|
|
|
NewPassword: changePasswordCommand.NewPassword,
|
|
|
UserId: changePasswordCommand.Operator.UserId,
|
|
|
})
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
|
|
|
}
|
|
|
} else {
|
|
|
err := smsServeGateway.CheckSmsCode(changePasswordCommand.Phone, changePasswordCommand.SmsCode)
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
|
...
|
...
|
@@ -65,7 +77,9 @@ func (srv UserService) ChangePassword(changePasswordCommand *command.ChangePassw |
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
|
|
|
}
|
|
|
return changePasswordCommand, nil
|
|
|
}
|
|
|
|
|
|
return struct{}{}, nil
|
|
|
}
|
|
|
|
|
|
//ChangePhone 修改手机号
|
...
|
...
|
|