Browse Source

代码修改

zhangdongming 2 năm trước cách đây
mục cha
commit
8f835eaf7a

+ 3 - 4
AdminController/AiServeController.py

@@ -445,11 +445,10 @@ class AiServeView(View):
         if not ip:
         if not ip:
             return '未知国家'
             return '未知国家'
         ipInfo = CommonService.getIpIpInfo(ip, 'EN')
         ipInfo = CommonService.getIpIpInfo(ip, 'EN')
-        country_qs = CountryModel.objects.filter(country_code=ipInfo['country_code']).values('id')
+        country_qs = CountryModel.objects.filter(country_code=ipInfo['country_code']).values('id', 'country_name')
         if not country_qs.exists():
         if not country_qs.exists():
-            return country_qs[0]['country_name']
-        return '未知国家'
-
+            return '未知国家'
+        return country_qs[0]['country_name']
 
 
     def getAiDataList(self, request_dict, response):
     def getAiDataList(self, request_dict, response):
         year = request_dict.get('year', None)
         year = request_dict.get('year', None)