|
@@ -50,6 +50,8 @@ class WeatherView(View):
|
|
|
try:
|
|
|
city_obj = WeatherInfo(uid_set_qs[0]['tb_city_information_id'])
|
|
|
temp, humidity = city_obj.get_city_weather()
|
|
|
+ if not all([temp, humidity]):
|
|
|
+ return response.json(10, '获取天气失败')
|
|
|
return response.json(0, {'temp': temp, 'humidity': humidity})
|
|
|
except Exception as e:
|
|
|
print(e)
|