Merge pull request #252 from L1bw/dev

fix: 修复备用接口获取天气时显示失败的问题
This commit is contained in:
底层用户 2024-03-11 09:42:42 +08:00 committed by GitHub
commit 4b60e7edf1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -48,14 +48,14 @@ const getWeatherData = async () => {
console.log(result);
const data = result.result;
weatherData.adCode = {
city: data.city.city_name || "未知地区",
city: data.city.City || "未知地区",
// adcode: data.city.cityId,
};
weatherData.weather = {
weather: data.condition.condition,
temperature: data.condition.temp,
winddirection: data.condition.windDir,
windpower: data.condition.windLevel,
weather: data.condition.day_weather,
temperature: (+data.condition.max_degree + +data.condition.min_degree) / 2,
winddirection: data.condition.day_wind_direction,
windpower: data.condition.day_wind_power,
};
} else {
// Adcode