|
@@ -3190,20 +3190,25 @@ class alexaAuthView(TemplateView):
|
|
|
def valid_login(self, user_qs, password, response):
|
|
|
if not user_qs.exists():
|
|
|
return response.json(104)
|
|
|
- users = user_qs.values('userID', 'password')[0]
|
|
|
+ users = user_qs.values('userID', 'password', 'region_country')[0]
|
|
|
if not check_password(password, users['password']):
|
|
|
return response.json(111)
|
|
|
userID = users['userID']
|
|
|
- # uid_qs = Device_Info.objects.filter(userID_id=userID, isExist=1).values('UID', 'NickName', 'View_Password')
|
|
|
- # uid_arr = []
|
|
|
- # for uid_q in uid_qs:
|
|
|
- # uid_arr.append({'uid': uid_q['UID'], 'nick': uid_q['NickName'], 'password': uid_q['View_Password']})
|
|
|
+ region_country = users['region_country']
|
|
|
+
|
|
|
+ # 确认用户地区
|
|
|
+ region_code = 'US'
|
|
|
+ country_qs = CountryModel.objects.filter(id=region_country).values('region_id')
|
|
|
+ if country_qs.exists():
|
|
|
+ region_id = country_qs[0]['region_id']
|
|
|
+ if region_id == 4:
|
|
|
+ region_code = 'EU'
|
|
|
+
|
|
|
res = {
|
|
|
'userID': userID,
|
|
|
- # 'uid_arr': uid_arr
|
|
|
+ 'region_code': region_code
|
|
|
}
|
|
|
return response.json(0, res)
|
|
|
- # return response.json(0, res)
|
|
|
|
|
|
|
|
|
class alexaUidView(TemplateView):
|