|
@@ -165,26 +165,17 @@ class ShopifyView(View):
|
|
|
password = request_dict.get("password", None)
|
|
|
authcode = request_dict.get("authCode", None)
|
|
|
|
|
|
- if not all([email, password]):
|
|
|
+ if not all([email, password, authcode]):
|
|
|
return response.json(444)
|
|
|
|
|
|
- if authcode is None:
|
|
|
- # 查询是否在shopify有账号
|
|
|
- access_token = SHOPIFY_CONFIG["eu_token"]
|
|
|
- customer_data = ShopifyMultipass.search_customer_by_email("0ef557-2", access_token, email)
|
|
|
- if not customer_data['customers']:
|
|
|
- return response.json(10077)
|
|
|
-
|
|
|
- # 邮箱验证
|
|
|
- else:
|
|
|
- reds = RedisObject()
|
|
|
- identifyingCode = reds.get_data(key=email + '_identifyingCode')
|
|
|
- # 判断验证码是否过期
|
|
|
- if identifyingCode is False:
|
|
|
- return response.json(120)
|
|
|
- # 验证码是否正确
|
|
|
- if authcode != identifyingCode:
|
|
|
- return response.json(121)
|
|
|
+ reds = RedisObject()
|
|
|
+ identifyingCode = reds.get_data(key=email + '_identifyingCode')
|
|
|
+ # 判断验证码是否过期
|
|
|
+ if identifyingCode is False:
|
|
|
+ return response.json(120)
|
|
|
+ # 验证码是否正确
|
|
|
+ if authcode != identifyingCode:
|
|
|
+ return response.json(121)
|
|
|
|
|
|
# 注册
|
|
|
if Device_User.objects.filter(Q(username=email) | Q(userEmail=email)).exists():
|
|
@@ -256,9 +247,20 @@ class ShopifyView(View):
|
|
|
|
|
|
return response.json(0, {"accountStatus": 3, "accountRegionList": account_region_list})
|
|
|
elif shopify_country:
|
|
|
- return response.json(0, {"accountStatus": 2, "url": "官网登录链接"})
|
|
|
+ if shopify_country == "eu":
|
|
|
+ url = "https://eu.zositech.com/account/login"
|
|
|
+ elif shopify_country == "jp":
|
|
|
+ url = "https://www.zosi.jp/account/login"
|
|
|
+ elif shopify_country == "de":
|
|
|
+ url = "https://www.zositech.de/account/login"
|
|
|
+ elif shopify_country == "uk":
|
|
|
+ url = "https://www.zositech.co.uk/account/login"
|
|
|
+ else:
|
|
|
+ url = "https://www.zositech.com/account/login"
|
|
|
+ return response.json(0, {"accountStatus": 2, "url": url})
|
|
|
else:
|
|
|
- return response.json(0, {"accountStatus": 1, "url": "注册链接"})
|
|
|
+ url = "注册链接"
|
|
|
+ return response.json(0, {"accountStatus": 1, "url": url})
|
|
|
|
|
|
except Exception as e:
|
|
|
print(e)
|