|
@@ -1263,8 +1263,11 @@ class InitInfoView(View):
|
|
|
response = ResponseObject()
|
|
|
token = request_dict.get('token', None)
|
|
|
tko = TokenObject(token)
|
|
|
- userID = tko.userID
|
|
|
- return self.init_info(request_dict, userID, response)
|
|
|
+ if tko.code == 0:
|
|
|
+ userID = tko.userID
|
|
|
+ return self.init_info(request_dict, userID, response)
|
|
|
+ else:
|
|
|
+ return response.json(tko.code)
|
|
|
|
|
|
# 初始化设备token
|
|
|
def init_info(self, request_dict, userID, response):
|
|
@@ -1275,7 +1278,6 @@ class InitInfoView(View):
|
|
|
appBundleId = request_dict.get('appBundleId', None)
|
|
|
tz = request_dict.get('tz', '0')
|
|
|
lang = request_dict.get('lang', '') # 语言区域
|
|
|
- is_ver = request_dict.get('is_ver', 0) # 判断是否为对接新接口的app版本
|
|
|
now_time = int(time.time())
|
|
|
if all([token_val, push_type, appBundleId,userID]):
|
|
|
push_type = int(push_type)
|
|
@@ -1320,26 +1322,26 @@ class InitInfoView(View):
|
|
|
UserExModel.objects.create(**create_dict)
|
|
|
# 获取设备是否存在有已被删除
|
|
|
res = {'usmsg': 0} # 预留字段, 有版本app该字段去掉会报错
|
|
|
- if is_ver:
|
|
|
- # 评分
|
|
|
- res['grade'] = 1
|
|
|
- # 用户帮助
|
|
|
- res['usingHelp'] = 0
|
|
|
- # AP添加方式
|
|
|
- res['apAdd'] = 1
|
|
|
- # AP工具
|
|
|
- res['apTool'] = 1
|
|
|
- # 广告模块
|
|
|
- res['ad_module'] = {
|
|
|
- "time": 0,
|
|
|
- "ad_path": [
|
|
|
- "https://test.dvema.com/web/static/image/default_ad1",
|
|
|
- "https://test.dvema.com/web/static/image/default_ad2",
|
|
|
- "https://test.dvema.com/web/static/image/default_ad3",
|
|
|
- ]
|
|
|
- }
|
|
|
- res['init_img'] = 'https://test.dvema.com/web/static/image/default_start'
|
|
|
- # http: // test.dvema.com / web / static / image / default_start_750_1334.jpg
|
|
|
+ # if is_ver:
|
|
|
+ # # 评分
|
|
|
+ # res['grade'] = 1
|
|
|
+ # # 用户帮助
|
|
|
+ # res['usingHelp'] = 0
|
|
|
+ # # AP添加方式
|
|
|
+ # res['apAdd'] = 1
|
|
|
+ # # AP工具
|
|
|
+ # res['apTool'] = 1
|
|
|
+ # # 广告模块
|
|
|
+ # res['ad_module'] = {
|
|
|
+ # "time": 0,
|
|
|
+ # "ad_path": [
|
|
|
+ # "https://test.dvema.com/web/static/image/default_ad1",
|
|
|
+ # "https://test.dvema.com/web/static/image/default_ad2",
|
|
|
+ # "https://test.dvema.com/web/static/image/default_ad3",
|
|
|
+ # ]
|
|
|
+ # }
|
|
|
+ # res['init_img'] = 'https://test.dvema.com/web/static/image/default_start'
|
|
|
+ # # http: // test.dvema.com / web / static / image / default_start_750_1334.jpg
|
|
|
return response.json(0, res)
|
|
|
|
|
|
|