无法从 jhipster 应用程序中的控制器访问链接

问题描述 投票:0回答:1

我正在与 jhipster 合作并创建了一个测试控制器来查看我的应用程序是否正常工作

您可以在下面看到我的控制器:

@RestController
@Configuration
public class TestController {

    private static final Logger log = LoggerFactory.getLogger(TestController.class);

    @GetMapping("/test/github")
    public String testEndpoint() {
        log.info("Test endpoint called");
        return "Test endpoint response";
    }
}

在我的 SecurityConfiguration 文件中,我添加了以下行:

.requestMatchers(mvc.pattern("/test/github")).permitAll()

当我访问 http://localhost:8080/test/github 时,我会立即重定向到 http://localhost:8080/not-found 页面

不知道我错过了什么!

java spring-boot vue.js spring-security jhipster
1个回答
0
投票

您需要向项目的

SpaWebFilter
添加新条件。这是 JHipster 附带的

© www.soinside.com 2019 - 2024. All rights reserved.