Commit 89a3b434 authored by RobertDing's avatar RobertDing

FIX - del 冗余

parent c9b8b110
...@@ -22,8 +22,6 @@ import settings ...@@ -22,8 +22,6 @@ import settings
class Request(object): class Request(object):
URL = settings.BASE_URL
def __init__(self, subject): def __init__(self, subject):
self.subject = subject self.subject = subject
yingtz_key = base64.b64decode(open(settings.YINGTZ_KEY_TEST).read()) yingtz_key = base64.b64decode(open(settings.YINGTZ_KEY_TEST).read())
...@@ -76,10 +74,6 @@ class Request(object): ...@@ -76,10 +74,6 @@ class Request(object):
return content return content
def check_sign(self, content, sign): def check_sign(self, content, sign):
if isinstance(content, str):
content = base64.b16decode(content.upper)
cal_sign = hashlib.md5(content+settings.MD5KEY).hexdigest() cal_sign = hashlib.md5(content+settings.MD5KEY).hexdigest()
if sign == cal_sign: if sign != cal_sign:
return raise ValueError('check sign error')
raise Exception('check sign error')
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment