安装了jsonp/featch-jsonp去请求百度天气的api还是跨域,写我自己服务器的接口还是跨域,我猜肯定是服务器没有设置什么配置吧。所以我换了高德的api尝试一下成功了
百度
http://api.map.baidu.com/weather/v1/?district_id=440100&data_type=all&ak=xxxx
怎么请求都是跨域
高德
https://restapi.amap.com/v3/weather/weatherInfo?key=xxx&city=130300
成功