|
@@ -729,21 +729,23 @@ class refreshTokenViewV3(TemplateView):
|
|
|
return response.json(tko.code)
|
|
|
userID = tko.userID
|
|
|
tko.lang = lang
|
|
|
+
|
|
|
+ # 国外正式服,判断是否需要重新登陆
|
|
|
+ user_qs = Device_User.objects.filter(userID=userID).values('password', 'region_country')
|
|
|
+ if CONFIG_INFO == CONFIG_US or CONFIG_INFO == CONFIG_EUR:
|
|
|
+ country_id = user_qs[0]['region_country']
|
|
|
+ LOGGER.info('刷新token, country_id:{}'.format(country_id))
|
|
|
+ country_qs = CountryModel.objects.filter(id=country_id).values('region_id')
|
|
|
+ if country_qs.exists():
|
|
|
+ region_id = country_qs[0]['region_id']
|
|
|
+ if (CONFIG_INFO == CONFIG_US and region_id == 4) or \
|
|
|
+ (CONFIG_INFO == CONFIG_EUR and region_id != 4):
|
|
|
+ LOGGER.info('用户地区与请求的服务器配置不一致')
|
|
|
+ return response.json(309)
|
|
|
+
|
|
|
if password: # 检验密码
|
|
|
- user_qs = Device_User.objects.filter(userID=userID).values('password', 'region_country')
|
|
|
if not user_qs.exists():
|
|
|
return response.json(104)
|
|
|
-
|
|
|
- # 国外正式服,判断是否需要重新登陆
|
|
|
- if CONFIG_INFO == CONFIG_US or CONFIG_INFO == CONFIG_EUR:
|
|
|
- country_id = user_qs['region_country']
|
|
|
- country_qs = CountryModel.objects.filter(id=country_id).values('region_id')
|
|
|
- if country_qs.exists():
|
|
|
- region_id = country_qs[0]['region_id']
|
|
|
- if (CONFIG_INFO == CONFIG_US and region_id == 4) or \
|
|
|
- (CONFIG_INFO == CONFIG_EUR and region_id != 4):
|
|
|
- return response.json(309)
|
|
|
-
|
|
|
password = password.strip()
|
|
|
# 解密
|
|
|
if password_version == 'V1':
|
|
@@ -772,7 +774,6 @@ class refreshTokenViewV3(TemplateView):
|
|
|
# request_thread.start()
|
|
|
return response.json(0, res)
|
|
|
except Exception as e:
|
|
|
- print(e)
|
|
|
return response.json(500, 'error_line:{}, error_msg:{}'.format(e.__traceback__.tb_lineno, repr(e)))
|
|
|
|
|
|
|