You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
import axios from "axios";
|
|
|
|
|
|
|
|
|
|
type WeatherResponse = {
|
|
|
|
|
success: boolean,
|
|
|
|
|
code: number,
|
|
|
|
|
message: number,
|
|
|
|
|
data: any //响应数据
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//查询未来24小时,指定位置的地面气象变量信息
|
|
|
|
|
function query_surface_forecast(lat:number, lon: number)
|
|
|
|
|
{
|
|
|
|
|
return axios({
|
|
|
|
|
method: "POST",
|
|
|
|
|
url: "/onlinetest/htfp/weather/v1surface/querySurfaceForecast",
|
|
|
|
|
headers: {"Content-Type": "application/json"},
|
|
|
|
|
data: {
|
|
|
|
|
latitude: lat,
|
|
|
|
|
longitude: lon,
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//查询未来24小时,指定位置和高度的高空气象变量信息
|
|
|
|
|
function query_upper_forecast(lat:number, lon: number, level:number){
|
|
|
|
|
return axios({
|
|
|
|
|
method: "POST",
|
|
|
|
|
url: "/onlinetest/htfp/weather/v1upper/queryUpperForecast",
|
|
|
|
|
headers: {"Content-Type": "application/json"},
|
|
|
|
|
data: {
|
|
|
|
|
latitude: lat,
|
|
|
|
|
longitude:lon,
|
|
|
|
|
level: level
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export {query_upper_forecast, query_surface_forecast}
|