|
@@ -32,7 +32,7 @@ from ratelimit.decorators import ratelimit
|
|
from Ansjer.config import AuthCode_Expire, SERVER_DOMAIN, APNS_CONFIG, JPUSH_CONFIG, FCM_CONFIG, TUTK_PUSH_DOMAIN
|
|
from Ansjer.config import AuthCode_Expire, SERVER_DOMAIN, APNS_CONFIG, JPUSH_CONFIG, FCM_CONFIG, TUTK_PUSH_DOMAIN
|
|
from Controller.CheckUserData import DataValid, date_handler, RandomStr
|
|
from Controller.CheckUserData import DataValid, date_handler, RandomStr
|
|
from Model.models import Device_User, Role, UidPushModel, UserOauth2Model, UserExModel, Device_Info, UidSetModel, \
|
|
from Model.models import Device_User, Role, UidPushModel, UserOauth2Model, UserExModel, Device_Info, UidSetModel, \
|
|
- UserAppFrequencyModel, CountryIPModel, UserRegionModel
|
|
|
|
|
|
+ UserAppFrequencyModel, CountryIPModel
|
|
from Object.AWS.SesClassObject import SesClassObject
|
|
from Object.AWS.SesClassObject import SesClassObject
|
|
from Object.AliSmsObject import AliSmsObject
|
|
from Object.AliSmsObject import AliSmsObject
|
|
from Object.RedisObject import RedisObject
|
|
from Object.RedisObject import RedisObject
|
|
@@ -1782,10 +1782,6 @@ class v3LoginView(TemplateView):
|
|
if oauth_qs.exists():
|
|
if oauth_qs.exists():
|
|
auth_type = oauth_qs[0].authType
|
|
auth_type = oauth_qs[0].authType
|
|
|
|
|
|
- region_id = 0
|
|
|
|
- user_region_qs = UserRegionModel.objects.filter(user_id=userID)
|
|
|
|
- if user_region_qs.exists():
|
|
|
|
- region_id = user_region_qs[0].region_id
|
|
|
|
|
|
|
|
if tko.code == 0:
|
|
if tko.code == 0:
|
|
now_time = datetime.datetime.utcnow().replace(tzinfo=utc).astimezone(utc)
|
|
now_time = datetime.datetime.utcnow().replace(tzinfo=utc).astimezone(utc)
|
|
@@ -1809,7 +1805,6 @@ class v3LoginView(TemplateView):
|
|
# res['fingerprint_key'] = CommonService.encode_data(content=users['fingerprint_key'], start=2)
|
|
# res['fingerprint_key'] = CommonService.encode_data(content=users['fingerprint_key'], start=2)
|
|
res['authType'] = auth_type
|
|
res['authType'] = auth_type
|
|
res['subscribe_email'] = users['subscribe_email'] if users['subscribe_email'] is not None else ''
|
|
res['subscribe_email'] = users['subscribe_email'] if users['subscribe_email'] is not None else ''
|
|
- res['regionID'] = region_id
|
|
|
|
return response.json(0, res)
|
|
return response.json(0, res)
|
|
else:
|
|
else:
|
|
return response.json(tko.code)
|
|
return response.json(tko.code)
|
|
@@ -3253,10 +3248,6 @@ class v3LoginByCodeView(View):
|
|
if oauth_qs.exists():
|
|
if oauth_qs.exists():
|
|
auth_type = oauth_qs[0].authType
|
|
auth_type = oauth_qs[0].authType
|
|
|
|
|
|
- region_id = 0
|
|
|
|
- user_region_qs = UserRegionModel.objects.filter(user_id=userID)
|
|
|
|
- if user_region_qs.exists():
|
|
|
|
- region_id = user_region_qs[0].region_id
|
|
|
|
|
|
|
|
if tko.code == 0:
|
|
if tko.code == 0:
|
|
now_time = datetime.datetime.utcnow().replace(tzinfo=utc).astimezone(utc)
|
|
now_time = datetime.datetime.utcnow().replace(tzinfo=utc).astimezone(utc)
|
|
@@ -3277,7 +3268,6 @@ class v3LoginByCodeView(View):
|
|
res['userEmail'] = users['userEmail'] if users['userEmail'] is not None else ''
|
|
res['userEmail'] = users['userEmail'] if users['userEmail'] is not None else ''
|
|
res['phone'] = users['phone'] if users['phone'] is not None else ''
|
|
res['phone'] = users['phone'] if users['phone'] is not None else ''
|
|
res['authType'] = auth_type
|
|
res['authType'] = auth_type
|
|
- res['region_id'] = region_id
|
|
|
|
return response.json(0, res)
|
|
return response.json(0, res)
|
|
else:
|
|
else:
|
|
return response.json(tko.code)
|
|
return response.json(tko.code)
|
|
@@ -3508,11 +3498,6 @@ class AppleAuthLogin(View):
|
|
auth_type = oauth_qs[0].authType
|
|
auth_type = oauth_qs[0].authType
|
|
res['authType'] = auth_type
|
|
res['authType'] = auth_type
|
|
|
|
|
|
- region_id = 0
|
|
|
|
- user_region_qs = UserRegionModel.objects.filter(user_id=userID)
|
|
|
|
- if user_region_qs.exists():
|
|
|
|
- region_id = user_region_qs[0].region_id
|
|
|
|
- res['region_id'] = region_id
|
|
|
|
user_qs.update(last_login=now_time, online=True)
|
|
user_qs.update(last_login=now_time, online=True)
|
|
return response.json(0, res)
|
|
return response.json(0, res)
|
|
|
|
|