fix: 修复备用接口获取天气时显示失败的问题

This commit is contained in:
Libw·I 2024-02-24 21:18:09 +08:00
parent c068f676d1
commit 550545fa3e
No known key found for this signature in database
GPG Key ID: 1B3ED5767A6BEB5E

View File

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