前端访问外部 url 跨域问题,从后端解决
@GetMapping("/list")
@ResponseBody
public static JSONObject list() {
RestTemplate restTemplate = new RestTemplate();
String url = "http://t.xxx.net/api/weather/city/xxx";
JSONObject result = restTemplate.getForObject(url, JSONObject.class);
return result;
}