Skip to content

Commit

Permalink
Merge pull request #368 from DTStack/issue_363
Browse files Browse the repository at this point in the history
[issue_363][Taier-all] fix user not login #363
  • Loading branch information
vainhope authored Apr 16, 2022
2 parents 42c0a3d + 7c31a4a commit 85bab08
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ public interface CommonConstant {

String JOB_ID = "${jobId}";

String LOGIN = "login";

String DOWNLOAD_LOG = "/taier/developDownload/downloadJobLog?jobId=%s&taskType=%s&tenantId=%s";

}
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ protected void addArgumentResolvers(List<HandlerMethodArgumentResolver> argument

@Override
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(loginInterceptor()).addPathPatterns("/^((?!login).)*$");
registry.addInterceptor(loginInterceptor()).addPathPatterns("/**");
super.addInterceptors(registry);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@
import org.springframework.validation.BindingResult;
import org.springframework.validation.FieldError;
import org.springframework.web.bind.MethodArgumentNotValidException;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice;

import javax.validation.ConstraintViolationException;
import javax.xml.bind.ValidationException;
import java.util.List;

@ControllerAdvice("com.dtstack.taiger.develop.controller.*")
@RestControllerAdvice
public class ResponseAdvisor implements ResponseBodyAdvice<Object> {

private final static Logger LOGGER = LoggerFactory.getLogger(ResponseAdvisor.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

package com.dtstack.taier.develop.interceptor;

import com.dtstack.taier.common.constant.CommonConstant;
import com.dtstack.taier.common.exception.ErrorCode;
import com.dtstack.taier.common.exception.RdosDefineException;
import com.dtstack.taier.develop.utils.CookieUtil;
Expand All @@ -36,6 +37,9 @@ public class LoginInterceptor extends HandlerInterceptorAdapter {
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) {
String requestURI = request.getRequestURI();
if(requestURI.contains(CommonConstant.LOGIN)){
return true;
}
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("{}:{}", requestURI, request.getParameterMap());
}
Expand Down

0 comments on commit 85bab08

Please sign in to comment.