Browse Source

解决v3设备列表在redis中保存的异常

tanghongbin 5 years ago
parent
commit
425c4f6602
1 changed files with 2 additions and 2 deletions
  1. 2 2
      Controller/EquipmentManagerV3.py

+ 2 - 2
Controller/EquipmentManagerV3.py

@@ -304,7 +304,7 @@ class EquipmentManagerV3(View):
                         p['ucode'] = ''
                     data.append(p)
                 # 缓存时间为一个钟
-                redisObj.set_data(key='uid_qs_'+userID, val=data, expire=3600)
+                redisObj.set_data(key='uid_qs_'+userID, val=json.dumps(data), expire=3600)
                 result = data
                 print('分页')
                 # items=[]
@@ -326,7 +326,7 @@ class EquipmentManagerV3(View):
                     redis_value = json.loads(redis_value)
                 except Exception as e:
                     print(repr(e))
-                    return response.json(0, {'data': redis_value})
+                    return response.json(0, redis_value)
                 result = redis_value
 
             if NickName: