Răsfoiți Sursa

设备添加

chenshibin 4 ani în urmă
părinte
comite
af838bd4ec

+ 1 - 1
Controller/CloudStorage.py

@@ -258,7 +258,7 @@ class CloudStorageView(View):
         session = Session(
             aws_access_key_id=AWS_ACCESS_KEY_ID[vh_qs[0]["bucket__mold"]],
             aws_secret_access_key = AWS_SECRET_ACCESS_KEY[vh_qs[0]["bucket__mold"]],
-            aws_arn = AWS_ARN[vh_qs[0]["bucket__mold"]]
+            region_name=bucket__region
         )
         '''
             http://test.dvema.com/cloudstorage/signplaym3u8?uid=VVDHCVBYDKFMJRWA111A&channel=1&time=1586940120&sign=tktktktk

+ 26 - 2
Controller/EquipmentManager.py

@@ -385,10 +385,35 @@ def addInterface(request):
                     asy.start()
                     return response.json(10, 'illegal uid: {uid}'.format(uid=UID))
                 pass
+
+                pk = CommonService.getUserID(getUser=False)
+
                 is_bind = Device_Info.objects.filter(UID=UID, isShare=False).values('userID__userID')
                 # 判断是否有已绑定用户
+                # 判断是否有已绑定用户
                 if is_bind and isCheckMainUser == '1':
-                    isMainUserExists = True
+                    res = {
+                        'id': pk,
+                        'userID': userID,
+                        'NickName': NickName,
+                        'UID': UID,
+                        'View_Account': View_Account,
+                        'View_Password': View_Password,
+                        'ChannelIndex': ChannelIndex,
+                        'Type': Type,
+                        'isShare': '',
+                        'primaryUserID': '',
+                        'primaryMaster': '',
+                        'vodPrimaryUserID': '',
+                        'vodPrimaryMaster': '',
+                        'data_joined': '',
+                        'version': '',
+                        'isVod': '',
+                        'isExist': ''
+                    }
+                    res['vod'] = {}
+                    res['isMainUserExists'] = 1
+                    return response.json(0, res)
 
                 userName = Device_User.objects.get(userID=userID).username
                 main_exist = Device_Info.objects.filter(UID=UID)
@@ -399,7 +424,6 @@ def addInterface(request):
                     vodPrimaryUserID = main_exist[0]['vodPrimaryUserID']
                     vodPrimaryMaster = main_exist[0]['vodPrimaryMaster']
 
-                pk = CommonService.getUserID(getUser=False)
 
                 try:
                     # 判断是否有用户绑定

+ 26 - 4
Controller/EquipmentManagerV3.py

@@ -88,10 +88,34 @@ class EquipmentManagerV3(View):
                                                args=(CommonService.get_ip_address(request), userID, 'addV3'))
                         asy.start()
                         return response.json(10, 'illegal uid: {uid}'.format(uid=UID))
+
+                    pk = CommonService.getUserID(getUser=False)
+
                     is_bind = Device_Info.objects.filter(UID=UID, isShare=False).values('userID__userID')
                     # 判断是否有已绑定用户
                     if is_bind and isCheckMainUser == '1':
-                        isMainUserExists = True
+                        res = {
+                            'id' : pk,
+                            'userID' : userID,
+                            'NickName' : NickName,
+                            'UID' : UID,
+                            'View_Account' : View_Account,
+                            'View_Password' : View_Password,
+                            'ChannelIndex' : ChannelIndex,
+                            'Type' : Type,
+                            'isShare' : '',
+                            'primaryUserID' : '',
+                            'primaryMaster' : '',
+                            'vodPrimaryUserID' : '',
+                            'vodPrimaryMaster' : '',
+                            'data_joined' : '',
+                            'version' : '',
+                            'isVod' : '',
+                            'isExist' : ''
+                        }
+                        res['vod'] = {}
+                        res['isMainUserExists'] = 1
+                        return response.json(0, res)
 
 
                     userName = Device_User.objects.get(userID=userID).username
@@ -103,7 +127,7 @@ class EquipmentManagerV3(View):
                         vodPrimaryUserID = main_exist[0]['vodPrimaryUserID']
                         vodPrimaryMaster = main_exist[0]['vodPrimaryMaster']
 
-                    pk = CommonService.getUserID(getUser=False)
+
 
                     try:
                         # 判断是否有用户绑定
@@ -157,8 +181,6 @@ class EquipmentManagerV3(View):
                         res = dvql[0]
                         res['vod'] = list(ubqs)
 
-                        if isMainUserExists:
-                            res['isMainUserExists'] = 1
                         return response.json(0, res)
 
                 else: