Merge pull request #1555 from ieachen/dev-feature

fix a bug in CTP login using UserProductInfo and AuthCode
This commit is contained in:
vn.py 2019-04-04 11:48:08 +08:00 committed by GitHub
commit 713b534ed8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -405,7 +405,7 @@ class CtpTdApi(TdApi):
""""""
if not error['ErrorID']:
self.authStatus = True
self.writeLog("交易授权验证成功")
self.gateway.write_log("交易授权验证成功")
self.login()
else:
self.gateway.write_error("交易授权验证失败", error)
@ -418,7 +418,7 @@ class CtpTdApi(TdApi):
self.login_status = True
self.gateway.write_log("交易登录成功")
# Confirm settelment
# Confirm settlement
req = {
"BrokerID": self.brokerid,
"InvestorID": self.userid
@ -662,7 +662,7 @@ class CtpTdApi(TdApi):
"UserID": self.userid,
"BrokerID": self.brokerid,
"AuthCode": self.auth_code,
"ProductInfo": self.product_info
"UserProductInfo": self.product_info
}
self.reqid += 1
@ -678,7 +678,8 @@ class CtpTdApi(TdApi):
req = {
"UserID": self.userid,
"Password": self.password,
"BrokerID": self.brokerid
"BrokerID": self.brokerid,
"UserProductInfo": self.product_info
}
self.reqid += 1