|
@@ -12,7 +12,7 @@ from django.views import View
|
|
from Ansjer.config import BASE_DIR, AWS_IOT_GETS3_PULL_CHINA_ID, AWS_IOT_GETS3_PULL_CHINA_SECRET, \
|
|
from Ansjer.config import BASE_DIR, AWS_IOT_GETS3_PULL_CHINA_ID, AWS_IOT_GETS3_PULL_CHINA_SECRET, \
|
|
AWS_IOT_GETS3_PULL_FOREIGN_ID, AWS_IOT_GETS3_PULL_FOREIGN_SECRET, AWS_ARN, AWS_IOT_SES_ACCESS_CHINA_REGION, \
|
|
AWS_IOT_GETS3_PULL_FOREIGN_ID, AWS_IOT_GETS3_PULL_FOREIGN_SECRET, AWS_ARN, AWS_IOT_SES_ACCESS_CHINA_REGION, \
|
|
AWS_IOT_SES_ACCESS_FOREIGN_REGION_ASIA, AWS_IOT_SES_ACCESS_FOREIGN_REGION_EUROPE, \
|
|
AWS_IOT_SES_ACCESS_FOREIGN_REGION_ASIA, AWS_IOT_SES_ACCESS_FOREIGN_REGION_EUROPE, \
|
|
- AWS_IOT_SES_ACCESS_FOREIGN_REGION_AMERICA
|
|
|
|
|
|
+ AWS_IOT_SES_ACCESS_FOREIGN_REGION_AMERICA, SERVER_TYPE
|
|
from base64 import b64encode, encodebytes
|
|
from base64 import b64encode, encodebytes
|
|
from Controller.DeviceConfirmRegion import Device_Region
|
|
from Controller.DeviceConfirmRegion import Device_Region
|
|
from Model.models import Device_User, Device_Info, iotdeviceInfoModel, UIDCompanySerialModel, \
|
|
from Model.models import Device_User, Device_Info, iotdeviceInfoModel, UIDCompanySerialModel, \
|
|
@@ -113,7 +113,10 @@ class IotCoreView(View):
|
|
# 判断设备是否已注册证书
|
|
# 判断设备是否已注册证书
|
|
if not iotdeviceInfo_qs.exists():
|
|
if not iotdeviceInfo_qs.exists():
|
|
thingGroup = device_version + '_' + language
|
|
thingGroup = device_version + '_' + language
|
|
- ip = CommonService.get_ip_address(request)
|
|
|
|
|
|
+ if SERVER_TYPE == 'Ansjer.us_config.formal_settings': # 国外正式配置使用固定ip进行测试
|
|
|
|
+ ip = '67.220.90.13'
|
|
|
|
+ else:
|
|
|
|
+ ip = CommonService.get_ip_address(request)
|
|
region_id = Device_Region().get_device_region(ip)
|
|
region_id = Device_Region().get_device_region(ip)
|
|
|
|
|
|
iotClient = IOTClient(region_id)
|
|
iotClient = IOTClient(region_id)
|