|
@@ -228,10 +228,11 @@ class ShopifyView(View):
|
|
@staticmethod
|
|
@staticmethod
|
|
def shopify_register(request_dict, response):
|
|
def shopify_register(request_dict, response):
|
|
email = request_dict.get("email", None)
|
|
email = request_dict.get("email", None)
|
|
|
|
+ country_code = request_dict.get("countryCode", None)
|
|
password = request_dict.get("password", None)
|
|
password = request_dict.get("password", None)
|
|
authcode = request_dict.get("authCode", None)
|
|
authcode = request_dict.get("authCode", None)
|
|
|
|
|
|
- if not all([email, password, authcode]):
|
|
|
|
|
|
+ if not all([email, password, authcode, country_code]):
|
|
return response.json(444)
|
|
return response.json(444)
|
|
data_valid = DataValid()
|
|
data_valid = DataValid()
|
|
if data_valid.email_validate(email) is not True:
|
|
if data_valid.email_validate(email) is not True:
|
|
@@ -263,6 +264,12 @@ class ShopifyView(View):
|
|
# 创建用户
|
|
# 创建用户
|
|
password = make_password(password)
|
|
password = make_password(password)
|
|
new_userID = CommonService.getUserID(μs=False, setOTAID=True)
|
|
new_userID = CommonService.getUserID(μs=False, setOTAID=True)
|
|
|
|
+ country_code = country_code.upper()
|
|
|
|
+ countr_qs = CountryModel.objects.filter(country_code=country_code).values("id")
|
|
|
|
+ if countr_qs.exists():
|
|
|
|
+ region_country = countr_qs[0]['id']
|
|
|
|
+ else:
|
|
|
|
+ return response.json(173)
|
|
user_data = {
|
|
user_data = {
|
|
"username": email,
|
|
"username": email,
|
|
"NickName": email,
|
|
"NickName": email,
|
|
@@ -271,6 +278,8 @@ class ShopifyView(View):
|
|
"userID": new_userID,
|
|
"userID": new_userID,
|
|
"is_active": True,
|
|
"is_active": True,
|
|
"user_isValid": True,
|
|
"user_isValid": True,
|
|
|
|
+ "region_country": region_country,
|
|
|
|
+ "region_status": 1
|
|
}
|
|
}
|
|
Device_User.objects.create(**user_data)
|
|
Device_User.objects.create(**user_data)
|
|
reds.del_data(key=email + '_identifyingCode')
|
|
reds.del_data(key=email + '_identifyingCode')
|
|
@@ -381,8 +390,13 @@ class ShopifyView(View):
|
|
|
|
|
|
user_region_id = user_qs.values_list('region_country', flat=True).first()
|
|
user_region_id = user_qs.values_list('region_country', flat=True).first()
|
|
country_code = CountryModel.objects.filter(id=user_region_id).values_list("country_code", flat=True).first()
|
|
country_code = CountryModel.objects.filter(id=user_region_id).values_list("country_code", flat=True).first()
|
|
-
|
|
|
|
- return response.json(0, country_code)
|
|
|
|
|
|
+ if country_code:
|
|
|
|
+ return response.json(0, country_code)
|
|
|
|
+ elif CONFIG_INFO == CONFIG_EUR:
|
|
|
|
+ return response.json(0, "uk")
|
|
|
|
+ elif CONFIG_INFO == CONFIG_US:
|
|
|
|
+ return response.json(0, "us")
|
|
|
|
+ return response.json(173)
|
|
|
|
|
|
@staticmethod
|
|
@staticmethod
|
|
def get_country_domain_list(request_dict, response):
|
|
def get_country_domain_list(request_dict, response):
|