chenjunkai 6 жил өмнө
parent
commit
31b8852236

+ 4 - 4
Ansjer/config.py

@@ -40,6 +40,8 @@ TX_PHONE_APP_KEY= '7705976ca6e85fe7b86d6bc2d11f7783'
 #验证码超时时间
 AuthCode_Expire = 600
 
+RTMP_PUSH_URL = 'http://13.56.215.252:8091/hls'
+
 if SERVER_TYPE == 'local':
     NGINX_RTMP_STAT = 'http://192.168.136.45:8077/stat'
     SERVER_DOMAIN = 'http://192.168.136.45:8077'
@@ -48,16 +50,14 @@ if SERVER_TYPE == 'local':
     DOMAIN_HOST = '192.168.136.45'
     RTMP_PUSH_URL = 'rtmp://192.168.136.45:1935/hls'
 elif SERVER_TYPE == 'test':
-    NGINX_RTMP_STAT = 'http://13.56.215.252:82/stat'
+    NGINX_RTMP_STAT = 'http://test.dvema.com/stat'
     SERVER_DOMAIN = 'http://test.dvema.com'
     DOMAIN_HOST = 'test.dvema.com'
     DATABASE_DATA = 'AnsjerTest'
     SERVER_HOST = 'localhost'
-    RTMP_PUSH_URL = 'http://13.56.215.252:8091/hls'
 elif SERVER_TYPE == 'formal':
-    NGINX_RTMP_STAT = 'http://13.56.215.252:81/stat'
+    NGINX_RTMP_STAT = 'http://www.dvema.com/stat'
     SERVER_DOMAIN = 'http://www.dvema.com'
     DOMAIN_HOST = 'www.dvema.com'
     DATABASE_DATA = 'Ansjer81'
     SERVER_HOST = 'localhost'
-    RTMP_PUSH_URL = 'http://13.56.215.252:8091/hls'

+ 10 - 5
Controller/UserController.py

@@ -173,11 +173,14 @@ class registerView(TemplateView):
         reds = RedisObject()
         identifyingCode = reds.get_data(key=username + '_identifyingCode')
         if identifyingCode is False:
-            identifyingCode = reds.get_data(key=userEmail + '_identifyingCode')
-            if identifyingCode is False:
-                return response.json(120)
+            if userEmail:
+                identifyingCode = reds.get_data(key=userEmail + '_identifyingCode')
+                if identifyingCode is False:
+                    return response.json(120)
+                else:
+                    username = userEmail
             else:
-                username = userEmail
+                return response.json(120)
         if authCode != identifyingCode:
             return response.json(121)
         if dataValid.password_validate(password):
@@ -475,8 +478,10 @@ class ForgetPwdView(TemplateView):
         dataValid = DataValid()
         if dataValid.mobile_validate(userName):
             User = Device_User.objects.filter(username=userName)
-        if dataValid.email_validate(userName):
+        elif dataValid.email_validate(userName):
             User = Device_User.objects.filter(username=userName)
+        else:
+            return response.json(9)
         if User:
             email = User[0].userEmail
             userID = User[0].userID

+ 0 - 20
Service/CommonService.py

@@ -210,26 +210,6 @@ class CommonService:
                     eID = '13800' + timeID + '138000'
                     return eID
 
-    @staticmethod
-    def get_request_val(key):
-        request = get_request()
-        if request.method == 'GET':
-            request_dict = request.GET
-        if request.method == 'POST':
-            request_dict = request.POST
-        val = request_dict.get(key, None)
-        return val
-
-    @staticmethod
-    def req_path(request, ssl=False):
-        get_host = request.get_host()  # 获取请求地址
-        if ssl is True:
-            tran_p = "https://"
-        else:
-            tran_p = "http://"
-        url_all = tran_p + get_host
-        return url_all
-
     # 生成随机数
     @staticmethod
     def RandomStr(randomlength=8, number=True):