Explorar o código

获取用户信息返回用户id

peng %!s(int64=2) %!d(string=hai) anos
pai
achega
79ed07ffda
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      Controller/DeviceShare.py

+ 2 - 2
Controller/DeviceShare.py

@@ -218,12 +218,12 @@ class DeviceShareView(View):
         if UID is not None:
         if UID is not None:
             # 查询分享获得的用户
             # 查询分享获得的用户
             qs = Device_Info.objects.filter(UID=UID, isShare=True, primaryUserID=userID, isExist=1). \
             qs = Device_Info.objects.filter(UID=UID, isShare=True, primaryUserID=userID, isExist=1). \
-                values('userID__NickName', 'userID__username', 'userID__userEmail', 'userID__phone', 'id',
+                values('userID__NickName', 'userID__username', 'userID__userEmail', 'userID__phone', 'id', 'userID',
                        'userID__userIconPath')
                        'userID__userIconPath')
             data = []
             data = []
             # print(qs)
             # print(qs)
             for q in qs:
             for q in qs:
-                d = {'id': q['id']}
+                d = {'id': q['id'], 'userID': q['userID']}
                 if q['userID__NickName']:
                 if q['userID__NickName']:
                     d['user'] = q['userID__NickName']
                     d['user'] = q['userID__NickName']
                 elif q['userID__username']:
                 elif q['userID__username']: