[ISSUE #614] Redirect too many times after enable user login

WIP

WIP
This commit is contained in:
affe
2020-08-18 16:20:18 +08:00
committed by GitHub
parent 3c32be5ace
commit fc042efef8
3 changed files with 14 additions and 1 deletions

View File

@@ -48,7 +48,18 @@ public class AuthWebMVCConfigurerAdapter extends WebMvcConfigurerAdapter {
@Override
public void addInterceptors(InterceptorRegistry registry) {
if (configure.isLoginRequired()) {
registry.addInterceptor(authInterceptor).excludePathPatterns("/error", "/user/guide/**", "/login/**");
registry.addInterceptor(authInterceptor).addPathPatterns(
"/cluster/**",
"/consumer/**",
"/dashboard/**",
"/message/**",
"/messageTrace/**",
"/monitor/**",
"/rocketmq/**",
"/ops/**",
"/producer/**",
"/test/**",
"/topic/**");
}
}

View File

@@ -62,6 +62,7 @@ public class LoginServiceImpl implements LoginService {
} catch (UnsupportedEncodingException e) {
logger.error("url encode:{}", url, e);
}
logger.debug("redirect url : {}", url);
WebUtil.redirect(response, request, "/#/login?redirect=" + url);
} catch (IOException e) {
logger.error("redirect err", e);

View File

@@ -12,6 +12,7 @@ spring.application.name=rocketmq-console
spring.http.encoding.charset=UTF-8
spring.http.encoding.enabled=true
spring.http.encoding.force=true
logging.level.root=INFO
logging.config=classpath:logback.xml
#if this value is empty,use env value rocketmq.config.namesrvAddr NAMESRV_ADDR | now, you can set it in ops page.default localhost:9876
rocketmq.config.namesrvAddr=