第51集,出现了第一次跨域问题!
    报错:

    1. Access to XMLHttpRequest at 'http://localhost:8201/admin/hosp/hospitalSet/findPageHospSet/1/3' from origin 'http://localhost:9528' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.

    如何解决的?
    加注解:@CrossOrigin
    这是为什么?也就是说:@CrossOrigin是什么含义?
    https://www.jianshu.com/p/45ed27b56d55
    想想也是,到底什么是跨域?只要请求的前三者有一种不一样,就属于跨域!(哪三者?
    http://localhost:8080
    请求协议、ip地址、端口号

    这里可想而知,是第三者不一样。并且不可能一样(因为这是同一台电脑。不可能出现两个进程同一个端口号!)所以必然出现跨域问题。如何解决?
    目前我所知道的两种方法:

    • 网关中配置(推荐)
    • 注解@CrossOrigin

    听说这个注解方式不太安全,我也不是很了解
    ================================================================================================================================================