| | |
| | | import com.ruoyi.company.api.RemoteCompanyUserService; |
| | | import com.ruoyi.company.api.domain.Company; |
| | | import com.ruoyi.company.api.domain.User; |
| | | import com.ruoyi.company.api.domain.dto.MgtCompanyDTO; |
| | | import com.ruoyi.company.api.model.RegisterUser; |
| | | import com.ruoyi.system.api.RemoteUserService; |
| | | import com.ruoyi.system.api.domain.SysUser; |
| | |
| | | recordLogService.recordLogininfor(username, Constants.REGISTER, "注册成功"); |
| | | } |
| | | |
| | | public void companyRegister(RegisterUser registerUser) { |
| | | public void companyRegister(MgtCompanyDTO registerUser) { |
| | | String accountName = registerUser.getAccountName(); |
| | | String password = registerUser.getPassword(); |
| | | // 用户名或密码为空 错误 |
| | |
| | | if (Objects.isNull(sysUser)){ |
| | | throw new ServiceException("用户不存在"); |
| | | } |
| | | if (!SecurityUtils.matchesPassword(SecurityUtils.encryptPassword(dto.getOldPassword()), sysUser.getPassword())){ |
| | | if (!SecurityUtils.matchesPassword(dto.getOldPassword(), sysUser.getPassword())){ |
| | | throw new ServiceException("原密码错误"); |
| | | } |
| | | sysUser.setPassword(SecurityUtils.encryptPassword(dto.getNewPassword())); |