POST api/WebInterface/Agent/LoginFromOffcialSite
通过官方网站对代理商用户进行嵌套登陆,获取代理商会话所需的KEY。
Request Information
URI Parameters
None.
Body Parameters
AgentLoginParm| Name | Description | Type | Additional information |
|---|---|---|---|
| username |
用户名 |
string |
Required |
| password |
密码的密文。 按以下方式获得: byte[] KEY=SHA256(Utf8.GetBytes(官方会话KEY+UPPER_MD5(官方代理商登陆密码))) byte[] keyForDes = 取KEY的前24字节(合192位) byte[] value = TripleDes(Utf8.GetBytes(UPPER_MD5(代理商登陆密码)),KeyForDes) password=ToBase64String(value) 对UPPER_MD5()计算过程的描述: byte[] valueBuffer = Utf8.GetBytes(待运算的字符串) byte[] md5buffer = Md5(valueBuffer); string value = FormatString(md5Buffer,"x2)/*这个的意思是转换成bcd字符串,一个字节变成两个字符0xae= "ae",0x0a="0a"*/ string returnvalue = upper(value);全部转换成大写,仍然是每两个字符表示一个字节。 请不要指责这个脱库子放屁的处理,因为我们要兼容老版本,新版本只能如此。 |
string |
Required |
| personalmemberid |
个人会员代码 |
integer |
None. |
| bindtousername |
将当前个人用户与代理商用户绑定,True登陆成功执行绑定。 只有代理商登陆是成功的,且提供了personalmemberid两者的绑定才能成功。 |
boolean |
None. |
Request Formats
application/json, text/json
{
"username": "sample string 1",
"password": "sample string 2",
"personalmemberid": 3,
"bindtousername": true
}
application/xml, text/xml
<AgentLoginParm xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/DigitalScience.DataTransfer.Tour.V5.Parm.WebInterface"> <bindtousername>true</bindtousername> <password>sample string 2</password> <personalmemberid>3</personalmemberid> <username>sample string 1</username> </AgentLoginParm>
application/x-www-form-urlencoded
Sample not available.
application/bson
Binary JSON content. See http://bsonspec.org for details.
Response Information
Resource Description
通过官方网站对代理商用户进行嵌套登陆,获取代理商会话所需的KEY。
AgentLoginResult| Name | Description | Type | Additional information |
|---|---|---|---|
| statuscode |
状态码,0表示登陆成功。 |
integer |
None. |
| errmessage |
错误描述 |
string |
None. |
| agentkey |
代理商的会话密钥密文。 解密办法: String KEY=官方代理商会话密钥+UPPER_MD5(官方代理商密码) byte[] KeyBuffer = HMACSHA256(UTF8.GetBytes(KEY)) byte[] keyForDeTripDes= KeyBuffer的前24个字节(192位) byte[] agentkeybuffer= GetBytesFromBase64String(agentkey) byte[] agentkeybytes = TripleDes(agentkeybuffer,keyForDeTripDes)/*解密*/ string 真正的代理 KEY字符串= Utf8.GetString(agentkeybytes) 对UPPER_MD5()计算过程的描述: byte[] valueBuffer = Utf8.GetBytes(待运算的字符串) byte[] md5buffer = Md5(valueBuffer); string value = FormatString(md5Buffer,"x2)/*这个的意思是转换成bcd字符串,一个字节变成两个字符0xae= "ae",0x0a="0a"*/ string returnvalue = upper(value);全部转换成大写,仍然是每两个字符表示一个字节。 请不要指责这个脱库子放屁的处理,因为我们要兼容老版本,新版本只能如此。 |
string |
None. |
| agentname |
代理商的名称,用于显示在客户端,提醒当前操作人员。 |
string |
None. |
| agenttypecode |
代理商的客户类型 |
string |
None. |
| agenttype |
代理商的客户类型名称 |
string |
None. |
| agentid |
代理商的单位ID |
string |
None. |
Response Formats
application/json, text/json
{
"statuscode": 1,
"errmessage": "sample string 2",
"agentkey": "sample string 3",
"agentname": "sample string 4",
"agenttypecode": "sample string 5",
"agenttype": "sample string 6",
"agentid": "sample string 7"
}
application/xml, text/xml
<AgentLoginResult xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/DigitalScience.DataTransfer.Tour.V5.Result.WebInterface"> <agentid>sample string 7</agentid> <agentkey>sample string 3</agentkey> <agentname>sample string 4</agentname> <agenttype>sample string 6</agenttype> <agenttypecode>sample string 5</agenttypecode> <errmessage>sample string 2</errmessage> <statuscode>1</statuscode> </AgentLoginResult>
application/bson
Binary JSON content. See http://bsonspec.org for details.