新增agv相关接口

This commit is contained in:
jinling.yang
2024-02-22 17:16:16 +08:00
parent 0ca4165219
commit da97fce6d5
4 changed files with 68 additions and 7 deletions

View File

@@ -34,8 +34,6 @@ class Http(models.AbstractModel):
# if abs(int(datas['HTTP_TIMESTAMP']) - timestamp_str) > deltime.seconds:
# raise AuthenticationError('请求已过期')
post_time = int(datas['HTTP_TIMESTAMP'])
_logger.info('HTTP_TIMESTAMP:%s' % post_time)
_logger.info('HTTP_CHECKSTR:%s' % datas['HTTP_CHECKSTR'])
datetime_post = datetime.fromtimestamp(post_time)
datetime_now = datetime.now().replace(microsecond=0)
datetime_del = datetime_now + timedelta(seconds=5)
@@ -43,8 +41,11 @@ class Http(models.AbstractModel):
raise AuthenticationError('请求已过期')
check_str = '%s%s%s' % (datas['HTTP_TOKEN'], post_time, factory_secret.sf_secret_key)
check_sf_str = hashlib.sha1(check_str.encode('utf-8')).hexdigest()
_logger.info('check_str:%s' % check_sf_str)
_logger.info('HTTP_TIMESTAMP:%s' % post_time)
_logger.info('HTTP_CHECKSTR:%s' % datas['HTTP_CHECKSTR'])
_logger.info('check_sf_str:%s' % check_sf_str)
_logger.info('check_str:%s' % check_str)
_logger.info('sf_secret_key:%s' % factory_secret.sf_secret_key)
# if check_sf_str != datas['HTTP_CHECKSTR']:
# raise AuthenticationError('数据校验不通过')
else: