From b30b83722a61864c659a10922b0a11a2898129dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=B9=E5=89=8D=E6=98=8E?= <909355014@qq.com> Date: Mon, 12 Sep 2022 16:50:35 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=A7=E5=8D=8E=E6=88=AA=E5=9B=BEbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/third/dahua.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/third/dahua.py b/apps/third/dahua.py index d4137997..277b8e86 100644 --- a/apps/third/dahua.py +++ b/apps/third/dahua.py @@ -15,6 +15,7 @@ from apps.utils.my_rsa import encrypt_data from apps.utils.tools import convert_to_base64, print_roundtrip from django.utils.timezone import now from apps.third.tapis import dhapis +from apps.utils.snowflake import idWorker requests.packages.urllib3.disable_warnings() myLogger = logging.getLogger('log') @@ -148,7 +149,7 @@ class DhClient: if '$' in code: d_code = code.split('$')[0] json_data['deviceCode'] = d_code - json_data['params'] = '{\"method\":\"dev.snap\",\"id\":123,\"params\":{\"DevID\":\"' + \ + json_data['params'] = '{\"method\":\"dev.snap\",\"id\":'+int(idWorker.get_id())+',\"params\":{\"DevID\":\"' + \ str(d_code) + '\",\"DevChannel\":\"' + code + '\",\"PicNum\":1,\"SnapType\":1,\"CmdSrc\":0}}' _, res = self.request(**dhapis['dev_snap'], json=json_data) res = json.loads(res)