更新时间:2022-02-12 03:35:14
如果有人会有这个问题,我可以这样在WebsocketConfig中解决我的问题:
If someone will have this question, I solved my problem in WebsocketConfig like this:
@Override
public void registerStompEndpoints(StompEndpointRegistry registry) {
registry.addEndpoint("/chat").setAllowedOrigins("http://localhost:3000").withSockJS();
}