|
@@ -454,6 +454,26 @@ class CommonService:
|
|
|
print(e)
|
|
|
return False
|
|
|
|
|
|
+ @staticmethod
|
|
|
+ def check_time_stamp_token_without_distance(time_stamp, time_stamp_token):
|
|
|
+ """
|
|
|
+ 用于没有RTC设备的时间戳token校验
|
|
|
+ @param time_stamp: 时间戳
|
|
|
+ @param time_stamp_token: 时间戳token
|
|
|
+ @return: boolean True/False
|
|
|
+ """
|
|
|
+
|
|
|
+ if not all([time_stamp, time_stamp_token]):
|
|
|
+ return False
|
|
|
+ try:
|
|
|
+ token = CommonService.decode_data(time_stamp_token)
|
|
|
+ if token != time_stamp:
|
|
|
+ return False
|
|
|
+ return True
|
|
|
+ except Exception as e:
|
|
|
+ print(e)
|
|
|
+ return False
|
|
|
+
|
|
|
@staticmethod
|
|
|
def req_publish_mqtt_msg(thing_name, topic_name, msg):
|
|
|
# 通用发布MQTT消息函数
|