Commit c0df8aeb by chenjinjing

no message

parent e17adcb5
......@@ -4,6 +4,7 @@
import { getGuangFu } from "../data/interface/dataInterface";
import { getKeyValueOut, getOnceYBarChartOut } from "../dataPackage/out";
import { get } from "../util/request";
let guangfuData = {
......@@ -175,6 +176,35 @@ export async function getData(req, res) {
let ret:any = {};
ret['ztsj'] = getKeyValueOut('整体数据', guangfuData.ztsj);
//source=pc&weather_type=observe&province=上海&city=上海&county=浦东新区
let query = {
source:"pc",
weather_type:"observe",
province:"上海",
city:"上海",
county:"浦东新区"
}
let weatherData:any = await get("https://wis.qq.com/weather/common", query);
let weather = {
"天气":"",
"温度":"",
"风向":"",
"风力等级":"",
"湿度":"",
"降水量":""
}
if(weatherData) {
let observe = weatherData.body.data.observe;
weather = {
"天气":observe.weather,
"温度":observe.degree,
"风向":observe.wind_direction_name,
"风力等级":observe.wind_power,
"湿度":observe.humidity,
"降水量":observe.precipitation
}
}
ret['weather'] = {title:"天气", dataList:weather};
res.send(ret);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment