mirror of https://github.com/elunez/eladmin
Merge remote-tracking branch 'origin/master'
# Conflicts: # eladmin-common/src/main/java/me/zhengjie/config/ElPermissionConfig.javapull/189/head
commit
8480f0e1d5
|
@ -6,6 +6,7 @@ import org.springframework.web.servlet.config.annotation.CorsRegistry;
|
||||||
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
|
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
|
||||||
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
|
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
|
||||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||||
|
import java.nio.file.Paths;
|
||||||
|
|
||||||
import java.nio.file.Paths;
|
import java.nio.file.Paths;
|
||||||
|
|
||||||
|
|
|
@ -61,21 +61,21 @@ public class AuthenticationController {
|
||||||
@ApiOperation("登录授权")
|
@ApiOperation("登录授权")
|
||||||
@AnonymousAccess
|
@AnonymousAccess
|
||||||
@PostMapping(value = "/login")
|
@PostMapping(value = "/login")
|
||||||
public ResponseEntity login(@Validated @RequestBody AuthUser authorizationUser, HttpServletRequest request){
|
public ResponseEntity login(@Validated @RequestBody AuthUser authUser, HttpServletRequest request){
|
||||||
|
|
||||||
// 查询验证码
|
// 查询验证码
|
||||||
String code = redisService.getCodeVal(authorizationUser.getUuid());
|
String code = redisService.getCodeVal(authUser.getUuid());
|
||||||
// 清除验证码
|
// 清除验证码
|
||||||
redisService.delete(authorizationUser.getUuid());
|
redisService.delete(authUser.getUuid());
|
||||||
if (StringUtils.isBlank(code)) {
|
if (StringUtils.isBlank(code)) {
|
||||||
throw new BadRequestException("验证码已过期");
|
throw new BadRequestException("验证码已过期");
|
||||||
}
|
}
|
||||||
if (StringUtils.isBlank(authorizationUser.getCode()) || !authorizationUser.getCode().equalsIgnoreCase(code)) {
|
if (StringUtils.isBlank(authUser.getCode()) || !authUser.getCode().equalsIgnoreCase(code)) {
|
||||||
throw new BadRequestException("验证码错误");
|
throw new BadRequestException("验证码错误");
|
||||||
}
|
}
|
||||||
final JwtUser jwtUser = (JwtUser) userDetailsService.loadUserByUsername(authorizationUser.getUsername());
|
final JwtUser jwtUser = (JwtUser) userDetailsService.loadUserByUsername(authUser.getUsername());
|
||||||
|
|
||||||
if(!jwtUser.getPassword().equals(EncryptUtils.encryptPassword(authorizationUser.getPassword()))){
|
if(!jwtUser.getPassword().equals(EncryptUtils.encryptPassword(authUser.getPassword()))){
|
||||||
throw new AccountExpiredException("密码错误");
|
throw new AccountExpiredException("密码错误");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
*
|
/*
|
||||||
Navicat Premium Data Transfer
|
Navicat Premium Data Transfer
|
||||||
|
|
||||||
Source Server : 本地
|
Source Server : 本地
|
||||||
|
|
Loading…
Reference in New Issue