Skip to content

Commit

Permalink
fix bug: deal with encode
Browse files Browse the repository at this point in the history
  • Loading branch information
CAOLINAN committed May 23, 2018
1 parent ea27b16 commit 6d95f54
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions ulordapi/errcode.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@
60300:{'errcode':60200,'reason':'活动取消.'},
60301:{'errcode':60301,'reason':'已赠送.'},

# 5.请求平台操作
60400:{'errcode':60400,'reason': '请求平台接口出错' },
}


Expand Down
6 changes: 5 additions & 1 deletion ulordapi/up.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@ def post(self, url, data):
self.log.debug(url)
self.log.debug(data)

# deal with unicode and utf-8
from utils import _byteify
data = _byteify(data=data)

# calculate U-Sign
self.calculate_sign(data)
# self.ulord_head = ulordconfig.get('ulord_head')
Expand All @@ -137,7 +141,7 @@ def post(self, url, data):
self.log.debug(r.json())
return r.json()
else:
return return_result(50000)
return return_result(60400)

def get(self, url):
"""
Expand Down

0 comments on commit 6d95f54

Please sign in to comment.