Browse Source

修改IPQuery接口,增加country_id

keiSenFront 2 years ago
parent
commit
e9b806a4f7
1 changed files with 3 additions and 0 deletions
  1. 3 0
      Object/IPWeatherObject.py

+ 3 - 0
Object/IPWeatherObject.py

@@ -16,6 +16,7 @@ class IPQuery:
         self.path = '/ip'
 
         self.district = None
+        self.countryId = None
 
         param = 'ip=' + ip
         url = self.host + self.path + '?' + param
@@ -29,7 +30,9 @@ class IPQuery:
             if res_data['ret'] == 200:
                 district = res_data['data']['district']
                 city = res_data['data']['city'] + '市'
+                country_id = res_data['data']['country_id']
                 self.district = district if district else city
+                self.countryId = country_id
 
 
 class WeatherInfo: