Browse Source

fix:修复uid为空bug

chenjunkai 6 years ago
parent
commit
ef3ddfcd8d
1 changed files with 6 additions and 4 deletions
  1. 6 4
      Controller/EquipmentManager.py

+ 6 - 4
Controller/EquipmentManager.py

@@ -297,6 +297,8 @@ def addInterface(request):
     View_Password = request_dict.get('View_Password', None)
     Type = request_dict.get('Type', None)
     ChannelIndex = request_dict.get('ChannelIndex', None)
+    if not all([UID, NickName, View_Account, View_Password, Type, ChannelIndex]):
+        return response.json(444, {'param': 'UID,NickName,View_Account,View_Password,Type,ChannelIndex'})
     tko = TokenObject(token)
     response.lang = tko.lang
     if tko.code == 0:
@@ -388,8 +390,8 @@ def queryInterface(request):
     page = request_dict.get('page', None)
     line = request_dict.get('line', None)
     NickName = request_dict.get('NickName', None)
-    page=int(page)
-    line=int(line)
+    page = int(page)
+    line = int(line)
     tko = TokenObject(token)
     response.lang = tko.lang
     if tko.code == 0:
@@ -399,7 +401,7 @@ def queryInterface(request):
             dvqs.filter(NickName__icontains=NickName)
         count = dvqs.count()
         dvql = dvqs[(page - 1) * line:page * line].values('id', 'userID', 'NickName', 'UID', 'View_Account',
-                                                          'View_Password','ChannelIndex', 'Type', 'isShare',
+                                                          'View_Password', 'ChannelIndex', 'Type', 'isShare',
                                                           'primaryUserID', 'primaryMaster', 'data_joined', 'version',
                                                           'isVod', 'isExist')
         dvls = CommonService.qs_to_list(dvql)
@@ -420,4 +422,4 @@ def queryInterface(request):
             data.append(p)
         return response.json(0, {'data': data, 'count': count})
     else:
-        return response.json(tko.code)
+        return response.json(tko.code)