0👍
One quick solution is to tell the controller method to enable CORS via CrossOrigin annotation on the method. So in your case just edit the controller method to this:
@GetMapping("/getNoticeList")
@CrossOrigin(origins = "http://localhost:3000")
public String getNoticeList() {
return "asdsad";
}
Assuming that you run your frontend app on port 3000.
Source:stackexchange.com