JHipster默认带有Spring Actuator。根据the document,我将能够使用像localhost/api这样的url来查看应用程序Rest API。然而,当我尝试访问它时,由于“未经授权(未授权)”,我得到了“拒绝访问”,即使我以管理员身份登录。在类SecurityConfiguration中,我更改以下方法访问Rest API - JHipster
@Override
public void configure(WebSecurity web) throws Exception {
web.ignoring()
.antMatchers("/scripts/**/*.{js,html}")
.antMatchers("/bower_components/**")
.antMatchers("/i18n/**")
.antMatchers("/assets/**")
.antMatchers("/swagger-ui.html")
.antMatchers("/api/**") <-- new added
.antMatchers("/api/register")
.antMatchers("/api/activate")
.antMatchers("/api/account/reset_password/init")
.antMatchers("/api/account/reset_password/finish")
.antMatchers("/test/**");
}
此更改只会产生一个异常。
如何访问我的应用程序Rest API?
你有没有试过看代码? – pmverma