springboot跨域问题

增加@CrossOrigin,跨域调用时header会自动增加Access-Control-Allow-Origin

@CrossOrigin(origins = "http://localhost:8081")
@RequestMapping(value = "/actpage" ,method = RequestMethod.GET)
public Page actpage(@RequestParam String userid)

参考文档 https://spring.io/guides/gs/rest-service-cors/

你可能感兴趣的:(springboot跨域问题)