|
@@ -1322,26 +1322,6 @@ 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
|
|
|
return response.json(0, res)
|
|
|
|
|
|
|
|
@@ -2064,6 +2044,37 @@ class alexaAuthView(TemplateView):
|
|
|
}
|
|
|
return response.json(0, res)
|
|
|
|
|
|
+class alexaUidView(TemplateView):
|
|
|
+ def post(self, request, *args, **kwargs):
|
|
|
+ request.encoding = 'utf-8'
|
|
|
+ # request_dict = json.loads(request.body.decode('utf-8'))
|
|
|
+ request_dict = request.POST
|
|
|
+ response = ResponseObject()
|
|
|
+ return self.validates(request_dict, response)
|
|
|
+
|
|
|
+ def get(self, request, *args, **kwargs):
|
|
|
+ request.encoding = 'utf-8'
|
|
|
+ request_dict = request.GET
|
|
|
+ response = ResponseObject()
|
|
|
+ return self.validates(request_dict, response)
|
|
|
+
|
|
|
+ def validates(self, request_dict, response):
|
|
|
+ userID = request_dict.get('alexa_user_id')
|
|
|
+ sid = request_dict.get('sid')
|
|
|
+ sst = request_dict.get('sst')
|
|
|
+ if sid == 'admin' and sst == 'admin':
|
|
|
+ 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']})
|
|
|
+ res = {
|
|
|
+ 'userID': userID,
|
|
|
+ 'uid_arr': uid_arr
|
|
|
+ }
|
|
|
+ return response.json(0,res)
|
|
|
+ else:
|
|
|
+ return response.json(107)
|
|
|
+
|
|
|
|
|
|
# 登出
|
|
|
class V2LogoutView(TemplateView):
|