|
@@ -9,6 +9,7 @@ import com.trade.common.constant.HttpStatus;
|
|
|
import com.trade.common.context.AuthenticationContextHolder;
|
|
|
import com.trade.common.exception.ServiceException;
|
|
|
import com.trade.common.utils.LoggerUtil;
|
|
|
+import com.trade.common.utils.StringUtils;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.springframework.security.authentication.AuthenticationManager;
|
|
|
import org.springframework.security.authentication.BadCredentialsException;
|
|
@@ -37,6 +38,9 @@ public class CustomerUserLoginServiceImpl implements CustomerUserLoginService {
|
|
|
|
|
|
@Override
|
|
|
public Map<String, String> login(LoginMo login) {
|
|
|
+ if (StringUtils.isEmpty(login.getUserName()) || StringUtils.isEmpty(login.getPassword())) {
|
|
|
+ throw new ServiceException("账号与密码不能为空", HttpStatus.BAD_REQUEST);
|
|
|
+ }
|
|
|
Map<String, String> tokenMap = new HashMap<>();
|
|
|
// 用户验证
|
|
|
Authentication authentication = null;
|