|
@@ -1,36 +1,21 @@
|
|
|
-#!/usr/bin/env python3
|
|
|
-# -*- coding: utf-8 -*-
|
|
|
-"""
|
|
|
-@Copyright (C) ansjer cop Video Technology Co.,Ltd.All rights reserved.
|
|
|
-@AUTHOR: ASJRD018
|
|
|
-@NAME: azoauth
|
|
|
-@software: PyCharm
|
|
|
-@DATE: 2020/1/13 17:01
|
|
|
-@Version: python3.6
|
|
|
-@MODIFY DECORD:ansjer dev
|
|
|
-@file: index.py
|
|
|
-@Contact: chanjunkai@163.com
|
|
|
-"""
|
|
|
import json
|
|
|
-import threading
|
|
|
+import logging
|
|
|
+import subprocess
|
|
|
import time
|
|
|
+from datetime import datetime
|
|
|
+
|
|
|
import requests
|
|
|
-import logging
|
|
|
-from django.views.generic import TemplateView
|
|
|
-from django.shortcuts import render_to_response
|
|
|
from django.http import JsonResponse
|
|
|
-from object.ResObject import ResObject
|
|
|
-from urllib.parse import urlencode
|
|
|
-import subprocess
|
|
|
-import uuid
|
|
|
-# from gevent.pool import Pool
|
|
|
+from django.shortcuts import render
|
|
|
+from django.views.generic import TemplateView
|
|
|
+
|
|
|
+from azoauth.config import *
|
|
|
from model.models import UserModel, UidRtspModel, AlexaAuthModel, UserCountModel, SwitchModel
|
|
|
+from object.RedisObject import RedisObject
|
|
|
+from object.ResObject import ResObject
|
|
|
from object.ResponseObject import ResponseObject
|
|
|
from object.tkObject import tkObject
|
|
|
from service.CommonService import CommonService
|
|
|
-from object.RedisObject import RedisObject
|
|
|
-from azoauth.config import *
|
|
|
-from datetime import datetime
|
|
|
|
|
|
|
|
|
class authView(TemplateView):
|
|
@@ -60,7 +45,7 @@ class authView(TemplateView):
|
|
|
'redirect_uri': redirect_uri,
|
|
|
'skill_name': 'zosi smart'
|
|
|
}
|
|
|
- return render_to_response("login.html", context)
|
|
|
+ return render("login.html", context)
|
|
|
|
|
|
|
|
|
# Anlapus登录
|
|
@@ -89,7 +74,8 @@ class authAnlapusView(TemplateView):
|
|
|
'redirect_uri': redirect_uri,
|
|
|
'skill_name': 'Anlapus'
|
|
|
}
|
|
|
- return render_to_response("login_anlapus.html", context)
|
|
|
+ return render("login_anlapus.html", context)
|
|
|
+
|
|
|
|
|
|
# loocam登录
|
|
|
class authLoocamView(TemplateView):
|
|
@@ -119,7 +105,7 @@ class authLoocamView(TemplateView):
|
|
|
}
|
|
|
logger = logging.getLogger('django')
|
|
|
logger.info('loocam请求登录网页,参数为{}'.format(context))
|
|
|
- return render_to_response("login_loocam.html", context)
|
|
|
+ return render("login_loocam.html", context)
|
|
|
|
|
|
|
|
|
class loginHandleView(TemplateView):
|
|
@@ -892,4 +878,4 @@ class VesseTest(TemplateView):
|
|
|
return response.json(code, content)
|
|
|
except Exception as e:
|
|
|
print(e)
|
|
|
- return response.json(500, repr(e))
|
|
|
+ return response.json(500, repr(e))
|