locky 3 жил өмнө
parent
commit
be3002add3

+ 2 - 5
Controller/IotCoreController.py

@@ -130,11 +130,8 @@ class IotCoreView(View):
                 return response.json(0, {'res': res})
             else:
                 region_id = request_dict.get('region_id', None)
-                if not region_id:
-                    # 根据配置信息确定region_id
-                    region_id = CommonService.confirm_region_id(request)
-
-                iotClient = IOTClient(int(region_id))
+                region_id = int(region_id) if region_id else CommonService.confirm_region_id(request)
+                iotClient = IOTClient(region_id)
                 # 拼接物品名
                 thingName = CommonService.get_thing_name(company_mark, thing_name_suffix)
                 thingGroup = device_version + '_' + language

+ 1 - 3
Controller/SerialNumberController.py

@@ -164,9 +164,7 @@ class SerialNumberView(View):
                     return response.json(5)
 
                 region_id = request_dict.get('region_id', None)
-                if not region_id:
-                    # 根据配置信息确定region_id
-                    region_id = CommonService.confirm_region_id(request)
+                region_id = int(region_id) if region_id else CommonService.confirm_region_id(request)
 
                 p2p_type = request_dict.get('p2ptype', 1)
                 if serial_number[9:10]: