|
@@ -314,8 +314,8 @@ class RegionView(View):
|
|
if not CommonService.check_time_stamp_token(time_stamp_token, time_stamp):
|
|
if not CommonService.check_time_stamp_token(time_stamp_token, time_stamp):
|
|
return response.json(13)
|
|
return response.json(13)
|
|
|
|
|
|
- # 查询app名
|
|
|
|
- app_inf_qs = App_Info.objects.filter(appBundleId=app_bundle_id).values('appName')
|
|
|
|
|
|
+ # 查询app信息
|
|
|
|
+ app_inf_qs = App_Info.objects.filter(appBundleId=app_bundle_id)
|
|
if not app_inf_qs.exists():
|
|
if not app_inf_qs.exists():
|
|
return response.json(173)
|
|
return response.json(173)
|
|
|
|
|
|
@@ -324,29 +324,36 @@ class RegionView(View):
|
|
lang_qs = LanguageModel.objects.filter(lang='en')
|
|
lang_qs = LanguageModel.objects.filter(lang='en')
|
|
lang = lang_qs[0]
|
|
lang = lang_qs[0]
|
|
|
|
|
|
- # 根据app名返回相应域名
|
|
|
|
- app_name = app_inf_qs[0]['appName']
|
|
|
|
|
|
+ # 根据包名确认app名称
|
|
|
|
+ app_name = 'Zosi'
|
|
|
|
+ if app_bundle_id in ['com.ansjer.loocamccloud', 'com.ansjer.loocamccloud_a']:
|
|
|
|
+ app_name = 'Loocam'
|
|
|
|
+ elif app_bundle_id in ['com.cloudlife.commissionf', 'com.cloudlife.commissionf_a']:
|
|
|
|
+ app_name = 'VSees'
|
|
|
|
+
|
|
country_qs = CountryLanguageModel.objects.filter(language_id=lang.id). \
|
|
country_qs = CountryLanguageModel.objects.filter(language_id=lang.id). \
|
|
annotate(push_api=F('country__region__push_api'))
|
|
annotate(push_api=F('country__region__push_api'))
|
|
- if 'Zosi' in app_name:
|
|
|
|
|
|
+
|
|
|
|
+ # 根据app名返回相应域名
|
|
|
|
+ if app_name == 'Zosi':
|
|
country_qs = country_qs.annotate(api=F('country__region__zosi_api'))
|
|
country_qs = country_qs.annotate(api=F('country__region__zosi_api'))
|
|
- elif 'Loocam' in app_name:
|
|
|
|
|
|
+ elif app_name == 'Loocam':
|
|
country_qs = country_qs.annotate(api=F('country__region__loocam_api'))
|
|
country_qs = country_qs.annotate(api=F('country__region__loocam_api'))
|
|
- elif '新中性' in app_name:
|
|
|
|
|
|
+ elif app_name == 'VSees':
|
|
country_qs = country_qs.annotate(api=F('country__region__neutral_api'))
|
|
country_qs = country_qs.annotate(api=F('country__region__neutral_api'))
|
|
else:
|
|
else:
|
|
country_qs = country_qs.annotate(api=F('country__region__api'))
|
|
country_qs = country_qs.annotate(api=F('country__region__api'))
|
|
country_qs = country_qs.values('country_id', 'country_name', 'api', 'push_api').order_by('country_id')
|
|
country_qs = country_qs.values('country_id', 'country_name', 'api', 'push_api').order_by('country_id')
|
|
|
|
|
|
- # app选择中国且不为中性,返回美洲域名
|
|
|
|
|
|
+ # app选择中国且不为VSees,返回美洲域名
|
|
if is_app:
|
|
if is_app:
|
|
- if '新中性' not in app_name:
|
|
|
|
|
|
+ if app_name != 'VSees':
|
|
for country in country_qs:
|
|
for country in country_qs:
|
|
if country['country_id'] == 1:
|
|
if country['country_id'] == 1:
|
|
country['push_api'] = 'https://push.dvema.com/'
|
|
country['push_api'] = 'https://push.dvema.com/'
|
|
- if 'Zosi' in app_name:
|
|
|
|
|
|
+ if app_name == 'Zosi':
|
|
country['api'] = 'https://api.zositech2.com/'
|
|
country['api'] = 'https://api.zositech2.com/'
|
|
- elif 'Loocam' in app_name:
|
|
|
|
|
|
+ elif app_name == 'Loocam':
|
|
country['api'] = 'https://api.loocam2.com/'
|
|
country['api'] = 'https://api.loocam2.com/'
|
|
else:
|
|
else:
|
|
country['api'] = 'https://www.dvema.com/'
|
|
country['api'] = 'https://www.dvema.com/'
|