|
@@ -129,8 +129,12 @@ class IotCoreView(View):
|
|
|
}
|
|
|
return response.json(0, {'res': res})
|
|
|
else:
|
|
|
+ # 获取并判断region_id是否有效
|
|
|
region_id = request_dict.get('region_id', None)
|
|
|
region_id = int(region_id) if region_id else CommonService.confirm_region_id(request)
|
|
|
+ if region_id not in [1, 2, 3, 4]:
|
|
|
+ return response.json(444, {'invalid region_id': region_id})
|
|
|
+
|
|
|
iotClient = IOTClient(region_id)
|
|
|
# 拼接物品名
|
|
|
thingName = CommonService.get_thing_name(company_mark, thing_name_suffix)
|