|
@@ -12,6 +12,7 @@ import simplejson as json
|
|
from dateutil.relativedelta import relativedelta
|
|
from dateutil.relativedelta import relativedelta
|
|
from django.core import serializers
|
|
from django.core import serializers
|
|
from django.utils import timezone
|
|
from django.utils import timezone
|
|
|
|
+from django.utils.crypto import constant_time_compare
|
|
from pyipip import IPIPDatabase
|
|
from pyipip import IPIPDatabase
|
|
|
|
|
|
from Ansjer.config import BASE_DIR, SERVER_DOMAIN_SSL, CONFIG_INFO, CONFIG_TEST, CONFIG_CN, SERVER_DOMAIN_TEST, \
|
|
from Ansjer.config import BASE_DIR, SERVER_DOMAIN_SSL, CONFIG_INFO, CONFIG_TEST, CONFIG_CN, SERVER_DOMAIN_TEST, \
|
|
@@ -656,7 +657,7 @@ GCqvlyw5dfxNA+EtxNE2wCW/LW7ENJlACgcfgPlBZtpLheWoZB/maw4=
|
|
|
|
|
|
time_list = []
|
|
time_list = []
|
|
while True:
|
|
while True:
|
|
- mid_time = datetime.datetime(start_time.year, start_time.month, start_time.day)+relativedelta(days=1)
|
|
|
|
|
|
+ mid_time = datetime.datetime(start_time.year, start_time.month, start_time.day) + relativedelta(days=1)
|
|
if mid_time < end_time:
|
|
if mid_time < end_time:
|
|
time_tuple = (CommonService.str_to_timestamp(start_time.strftime('%Y-%m-%d %H:%M:%S')),
|
|
time_tuple = (CommonService.str_to_timestamp(start_time.strftime('%Y-%m-%d %H:%M:%S')),
|
|
CommonService.str_to_timestamp(mid_time.strftime('%Y-%m-%d %H:%M:%S')))
|
|
CommonService.str_to_timestamp(mid_time.strftime('%Y-%m-%d %H:%M:%S')))
|
|
@@ -731,7 +732,6 @@ GCqvlyw5dfxNA+EtxNE2wCW/LW7ENJlACgcfgPlBZtpLheWoZB/maw4=
|
|
content = content + '(' + '云盘' + ')'
|
|
content = content + '(' + '云盘' + ')'
|
|
return content
|
|
return content
|
|
|
|
|
|
-
|
|
|
|
@staticmethod
|
|
@staticmethod
|
|
def is_cloud_device(ucode, device_type):
|
|
def is_cloud_device(ucode, device_type):
|
|
"""
|
|
"""
|
|
@@ -759,4 +759,12 @@ GCqvlyw5dfxNA+EtxNE2wCW/LW7ENJlACgcfgPlBZtpLheWoZB/maw4=
|
|
if any(i < 0 for i in number_list):
|
|
if any(i < 0 for i in number_list):
|
|
return False
|
|
return False
|
|
else:
|
|
else:
|
|
- return True
|
|
|
|
|
|
+ return True
|
|
|
|
+
|
|
|
|
+ @staticmethod
|
|
|
|
+ def check_password(password1, password2):
|
|
|
|
+ """
|
|
|
|
+ 比较密码
|
|
|
|
+ @param 返回True or False
|
|
|
|
+ """
|
|
|
|
+ return constant_time_compare(password1, password2)
|