| | |
| | | import com.ruoyi.company.api.domain.User; |
| | | import com.ruoyi.company.api.model.RegisterUser; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.jacoco.agent.rt.internal_43f5073.core.internal.flow.IFrame; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | import com.ruoyi.common.core.constant.CacheConstants; |
| | |
| | | } |
| | | |
| | | |
| | | public void companyLogin(RegisterUser registerUser) |
| | | public User companyLogin(RegisterUser registerUser) |
| | | { |
| | | String accountName = registerUser.getAccountName(); |
| | | String password = registerUser.getPassword(); |
| | | |
| | | R<User> r = remoteCompanyUserService.getUserByAccountName(accountName, SecurityConstants.INNER); |
| | | if (R.isError(r)){ |
| | | throw new ServiceException(r.getMsg()); |
| | | } |
| | | if (r.getData() == null){ |
| | | throw new ServiceException("账号不存在"); |
| | | } |
| | | if (!SecurityUtils.matchesPassword(r.getData().getPassword(), password)){ |
| | | throw new ServiceException("密码错误"); |
| | | } |
| | | return r.getData(); |
| | | } |
| | | } |