SparkMd5
This commit is contained in:
parent
71f2b5e30a
commit
42d05894fa
8
pom.xml
8
pom.xml
|
@ -122,6 +122,14 @@
|
|||
<artifactId>wechatpay-apache-httpclient</artifactId>
|
||||
<version>0.4.8</version>
|
||||
</dependency>
|
||||
<!-- https://mvnrepository.com/artifact/org.webjars.npm/spark-md5 -->
|
||||
<dependency>
|
||||
<groupId>org.webjars.npm</groupId>
|
||||
<artifactId>spark-md5</artifactId>
|
||||
<version>3.0.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
</project>
|
||||
|
|
|
@ -15,6 +15,7 @@ import org.springframework.web.bind.annotation.RequestBody;
|
|||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
|
@ -26,9 +27,9 @@ import java.util.Map;
|
|||
@Slf4j
|
||||
public class EmployeeController {
|
||||
|
||||
@Autowired
|
||||
@Resource
|
||||
private EmployeeService employeeService;
|
||||
@Autowired
|
||||
@Resource
|
||||
private JwtProperties jwtProperties;
|
||||
|
||||
/**
|
||||
|
|
|
@ -13,17 +13,19 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.DigestUtils;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
@Service
|
||||
public class EmployeeServiceImpl implements EmployeeService {
|
||||
|
||||
@Autowired
|
||||
@Resource
|
||||
private EmployeeMapper employeeMapper;
|
||||
|
||||
/**
|
||||
* 员工登录
|
||||
*
|
||||
* @param employeeLoginDTO
|
||||
* @return
|
||||
* @param employeeLoginDTO 登录信息
|
||||
* @return Employee
|
||||
*/
|
||||
public Employee login(EmployeeLoginDTO employeeLoginDTO) {
|
||||
String username = employeeLoginDTO.getUsername();
|
||||
|
@ -34,23 +36,25 @@ public class EmployeeServiceImpl implements EmployeeService {
|
|||
|
||||
//2、处理各种异常情况(用户名不存在、密码不对、账号被锁定)
|
||||
if (employee == null) {
|
||||
//账号不存在
|
||||
// 账号不存在
|
||||
throw new AccountNotFoundException(MessageConstant.ACCOUNT_NOT_FOUND);
|
||||
}
|
||||
|
||||
//密码比对
|
||||
// 密码比对
|
||||
// TODO 后期需要进行md5加密,然后再进行比对
|
||||
if (!password.equals(employee.getPassword())) {
|
||||
//密码错误
|
||||
// 密码错误
|
||||
throw new PasswordErrorException(MessageConstant.PASSWORD_ERROR);
|
||||
}
|
||||
|
||||
// 账号被锁定
|
||||
if (employee.getStatus() == StatusConstant.DISABLE) {
|
||||
//账号被锁定
|
||||
throw new AccountLockedException(MessageConstant.ACCOUNT_LOCKED);
|
||||
}
|
||||
|
||||
//3、返回实体对象
|
||||
|
||||
|
||||
// 3、返回实体对象
|
||||
return employee;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
sky:
|
||||
datasource:
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
host: localhost
|
||||
port: 3306
|
||||
host: 106.15.251.123
|
||||
port: 3305
|
||||
database: sky_take_out
|
||||
username: root
|
||||
password: root
|
||||
password: "02120212"
|
||||
|
|
Loading…
Reference in New Issue