Merge remote-tracking branch 'origin/master'

# Conflicts:
#	eladmin-common/src/main/java/me/zhengjie/config/ElPermissionConfig.java
pull/189/head
jyao 2019-11-05 09:20:41 +08:00
commit 8480f0e1d5
5 changed files with 8 additions and 7 deletions

View File

@ -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.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import java.nio.file.Paths;
import java.nio.file.Paths;

View File

@ -61,21 +61,21 @@ public class AuthenticationController {
@ApiOperation("登录授权")
@AnonymousAccess
@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)) {
throw new BadRequestException("验证码已过期");
}
if (StringUtils.isBlank(authorizationUser.getCode()) || !authorizationUser.getCode().equalsIgnoreCase(code)) {
if (StringUtils.isBlank(authUser.getCode()) || !authUser.getCode().equalsIgnoreCase(code)) {
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("密码错误");
}

0
git
View File

View File

View File

@ -1,4 +1,4 @@
*
/*
Navicat Premium Data Transfer
Source Server :