Skip to content

Commit

Permalink
Merge pull request #252 from L1bw/dev
Browse files Browse the repository at this point in the history
fix: 修复备用接口获取天气时显示失败的问题
  • Loading branch information
imsyy authored Mar 11, 2024
2 parents c068f67 + 550545f commit 4b60e7e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/components/Weather.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4b60e7e

Please sign in to comment.