1. 程式人生 > >Spring boot Ajax 跨域問題

Spring boot Ajax 跨域問題

This @CrossOrigin annotation enables cross-origin requests only for this specific method. By default, its allows all origins, all headers, the HTTP methods specified in the @RequestMappingannotation and a maxAge of 30 minutes is used. You can customize this behavior by specifying the value of one of the annotation attributes: 
originsmethodsallowedHeaders,exposedHeadersallowCredentials or maxAge. In this example, we only allow to send cross-origin requests.