|
@@ -34,7 +34,7 @@ class RegionCountryView(View):
|
|
|
if operation == 'initUserRegion':
|
|
|
return self.do_initUserRegion(token.userID, request_dict, response)
|
|
|
elif operation == 'initRegionDate':
|
|
|
- return self.do_initRegionDate(token.userID, request_dict, response)
|
|
|
+ return self.do_initRegionDate(request_dict, response)
|
|
|
else:
|
|
|
return response.json(404)
|
|
|
|
|
@@ -47,9 +47,11 @@ class RegionCountryView(View):
|
|
|
|
|
|
def do_initRegionDate(self, request_dict, response):
|
|
|
filepath = request_dict.get('filepath')
|
|
|
- fobj = open(filepath)
|
|
|
- region_list = json.loads(fobj)
|
|
|
|
|
|
+ with open(filepath, 'r', encoding='UTF-8') as f:
|
|
|
+ region_list = json.load(f)
|
|
|
+
|
|
|
+ #region_list = json.loads(fobj)
|
|
|
now_time = int(time.time())
|
|
|
|
|
|
for region in region_list:
|