作者 yangfu

密码更新修改,共创申请修改

... ... @@ -75,7 +75,8 @@ func (srv CooperationApplicationsService) SearchCooperationApplications(applicat
resultApplications, err := creationCooperationGateway.CooperationApplicationsSearch(allied_creation_cooperation.ReqCooperationApplicationSearch{
PageNumber: applicationQuery.PageNumber,
PageSize: applicationQuery.PageSize,
CompanyId: int(applicationQuery.Operator.CompanyId),
//CompanyId: int(applicationQuery.Operator.CompanyId),
OrgId: applicationQuery.Operator.OrgId,
CooperationApplicationStatus: applicationQuery.Status,
})
for i := 0; i < len(resultApplications.Grid.List); i++ {
... ...
... ... @@ -110,7 +110,7 @@ func (srv CooperationProjectService) PersonSearchCooperationProject(projectQuery
PageNumber: projectQuery.PageNumber,
PageSize: projectQuery.PageSize,
OrgId: projectQuery.OrgId,
UserBaseId: projectQuery.Operator.UserBaseId,
//UserBaseId: projectQuery.Operator.UserBaseId,
})
if err != nil {
return 0, nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
... ...
... ... @@ -18,6 +18,8 @@ type ChangePasswordCommand struct {
SmsCode string `cname:"短信验证码" json:"smsCode" valid:"Required"`
// 新密码
NewPassword string `cname:"新密码" json:"newPassword" valid:"Required"`
// 旧密码
OldPassword string `cname:"旧密码" json:"oldPassword" valid:"Required"`
}
func (phoneAuthChangePasswordCommand *ChangePasswordCommand) Valid(validation *validation.Validation) {
... ...
... ... @@ -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 修改手机号
... ...
... ... @@ -20,7 +20,7 @@ type (
ReqAuthChangePassword struct {
NewPassword string `json:"newPassword"`
OldPassword string `json:"oldPassword"`
UserId string `json:"userId"`
UserId int64 `json:"userId"`
}
DataAuthChangePassword struct {
... ...