@@ -9,11 +9,14 @@ import { Descriptions, Radio, Space, Switch } from 'antd'; | |||
import dayjs from 'dayjs'; | |||
import { useState } from 'react'; | |||
const requeststr = '{ "sign": "string", "key": "string", "code": "string", "name": "string", "typeName": "string", "uintName": "string" }'; | |||
const requeststr = '{ "code": "string", "name": "string", "typeName": "string", "uintName": "string" }'; | |||
const returnstr = '{ "statusCode": 0, "data": true, "succeeded": true, "errors": "string", "extras": "string", "timestamp": 0 }'; | |||
const publicrequestData = [ | |||
{ attribute: 'key', type: 'string', isrequired: "是", explicate: '平台秘钥' }, | |||
{ attribute: 'sign', type: 'string', isrequired: "是", explicate: '签名,详见 安全规则=>签名算法' } | |||
]; | |||
const requestData = [ | |||
{ attribute: 'key', type: 'string', isrequired: "是", explicate: '平台秘钥' }, | |||
{ attribute: 'sign', type: 'string', isrequired: "是", explicate: '签名,详见 安全规则=>签名算法' }, | |||
@@ -107,8 +110,17 @@ const App = () => ( | |||
<blockquote>{" POST http://localhost:5006/api/ExternalPlatform/Material/AddMaterial"}</blockquote> | |||
</Paragraph> | |||
<Title level={4}>公共请求参数</Title> | |||
HTTP头参数 | |||
<Paragraph> | |||
<Table pagination={{ position: ["none"] }} | |||
columns={requestColumns} dataSource={publicrequestData} /> | |||
</Paragraph> | |||
<Title level={4}>请求参数</Title> | |||
Body | |||
<Paragraph> | |||
<Table pagination={{ position: ["none"] }} | |||
columns={requestColumns} dataSource={requestData} /> | |||
@@ -125,6 +137,13 @@ const App = () => ( | |||
<blockquote>{"示例说明: post请求"}</blockquote> | |||
</Paragraph> | |||
<Title level={4}>公共请求数据示例</Title> | |||
<Paragraph> | |||
<blockquote>{"请求头添加如下信息"}</blockquote> | |||
<pre>{' "key: a92370b8-a633-47e6-9662-7755b8fe9ee4" \r\n "sign: 987DA29D82DE9A65F4DFB986170F5272" '}</pre> | |||
</Paragraph> | |||
<Title level={4}>请求数据示例</Title> | |||
<Paragraph> | |||
<blockquote>{"示例说明: post请求"}</blockquote> | |||
@@ -9,14 +9,15 @@ import { Descriptions, Radio, Space, Switch } from 'antd'; | |||
import dayjs from 'dayjs'; | |||
import { useState } from 'react'; | |||
const requeststr = '{ "sign": "string", "key": "string", "materialId": "string" }'; | |||
const requeststr = '{ "materialId": "string" }'; | |||
const returnstr = '{ "statusCode": 0, "data": true, "succeeded": true, "errors": "string", "extras": "string", "timestamp": 0 }'; | |||
const requestData = [ | |||
const publicrequestData = [ | |||
{ attribute: 'key', type: 'string', isrequired: "是", explicate: '平台秘钥' }, | |||
{ attribute: 'sign', type: 'string', isrequired: "是", explicate: '签名,详见 安全规则=>签名算法' }, | |||
{ attribute: 'sign', type: 'string', isrequired: "是", explicate: '签名,详见 安全规则=>签名算法' } | |||
]; | |||
const requestData = [ | |||
{ attribute: 'materialId', type: 'string', isrequired: "是", explicate: '物料Id' }, | |||
]; | |||
const returnData = [ | |||
@@ -104,8 +105,15 @@ const App = () => ( | |||
<blockquote>{" POST http://localhost:5006/api/ExternalPlatform/Material/UpdateMateria"}</blockquote> | |||
</Paragraph> | |||
<Title level={4}>公共请求参数</Title> | |||
HTTP头参数 | |||
<Paragraph> | |||
<Table pagination={{ position: ["none"] }} | |||
columns={requestColumns} dataSource={publicrequestData} /> | |||
</Paragraph> | |||
<Title level={4}>请求参数</Title> | |||
Body | |||
<Paragraph> | |||
<Table pagination={{ position: ["none"] }} | |||
columns={requestColumns} dataSource={requestData} /> | |||
@@ -122,6 +130,12 @@ const App = () => ( | |||
<blockquote>{"示例说明: post请求"}</blockquote> | |||
</Paragraph> | |||
<Title level={4}>公共请求数据示例</Title> | |||
<Paragraph> | |||
<blockquote>{"请求头添加如下信息"}</blockquote> | |||
<pre>{' "key: a92370b8-a633-47e6-9662-7755b8fe9ee4" \r\n "sign: 987DA29D82DE9A65F4DFB986170F5272" '}</pre> | |||
</Paragraph> | |||
<Title level={4}>请求数据示例</Title> | |||
<Paragraph> | |||
<blockquote>{"示例说明: post请求"}</blockquote> | |||
@@ -9,14 +9,15 @@ import { Descriptions, Radio, Space, Switch } from 'antd'; | |||
import dayjs from 'dayjs'; | |||
import { useState } from 'react'; | |||
const requeststr = '{ "sign": "f4f80596-3265-4530-9bfa-4a0613ff810f", "key": "f4f80596-3265-4530-9bfa-4a0613ff810f", "current": 1, "pageSize": 10, "name": "string" }'; | |||
const requeststr = '{ "current": 1, "pageSize": 10, "name": "string" }'; | |||
const returnstr = '{ "statusCode": 200, "data": { "data": [ { "id": null, "code": "SCFJ4017", "name": "红油", "typeName": null, "uintName": "g" } ], "total": 1 }, "succeeded": true, "errors": null, "extras": null, "timestamp": 1709174257 }'; | |||
const requestData = [ | |||
const publicrequestData = [ | |||
{ attribute: 'key', type: 'string', isrequired: "是", explicate: '平台秘钥' }, | |||
{ attribute: 'sign', type: 'string', isrequired: "是", explicate: '签名,详见 安全规则=>签名算法' }, | |||
{ attribute: 'sign', type: 'string', isrequired: "是", explicate: '签名,详见 安全规则=>签名算法' } | |||
]; | |||
const requestData = [ | |||
{ attribute: 'current', type: 'int', isrequired: "是", explicate: '当前页' }, | |||
{ attribute: 'pageSize', type: 'int', isrequired: "是", explicate: '页容量' }, | |||
{ attribute: 'name', type: 'string', isrequired: "否", explicate: '物料名称' }, | |||
@@ -152,8 +153,15 @@ const App = () => ( | |||
<blockquote>{" POST http://localhost:5006/api/ExternalPlatform/Material/GetMaterialPageList"}</blockquote> | |||
</Paragraph> | |||
<Title level={4}>公共请求参数</Title> | |||
HTTP头参数 | |||
<Paragraph> | |||
<Table pagination={{ position: ["none"] }} | |||
columns={requestColumns} dataSource={publicrequestData} /> | |||
</Paragraph> | |||
<Title level={4}>请求参数</Title> | |||
Body | |||
<Paragraph> | |||
<Table pagination={{ position: ["none"] }} | |||
columns={requestColumns} dataSource={requestData} /> | |||
@@ -184,6 +192,12 @@ const App = () => ( | |||
<blockquote>{"示例说明: post请求"}</blockquote> | |||
</Paragraph> | |||
<Title level={4}>公共请求数据示例</Title> | |||
<Paragraph> | |||
<blockquote>{"请求头添加如下信息"}</blockquote> | |||
<pre>{' "key: a92370b8-a633-47e6-9662-7755b8fe9ee4" \r\n "sign: 987DA29D82DE9A65F4DFB986170F5272" '}</pre> | |||
</Paragraph> | |||
<Title level={4}>请求数据示例</Title> | |||
<Paragraph> | |||
<blockquote>{"示例说明: post请求"}</blockquote> | |||
@@ -9,14 +9,15 @@ import { Descriptions, Radio, Space, Switch } from 'antd'; | |||
import dayjs from 'dayjs'; | |||
import { useState } from 'react'; | |||
const requeststr = '{ "sign": "string", "key": "string", "code": "string", "name": "string", "typeName": "string", "uintName": "string" }'; | |||
const requeststr = '{ "code": "string", "name": "string", "typeName": "string", "uintName": "string" }'; | |||
const returnstr = '{ "statusCode": 0, "data": true, "succeeded": true, "errors": "string", "extras": "string", "timestamp": 0 }'; | |||
const requestData = [ | |||
const publicrequestData = [ | |||
{ attribute: 'key', type: 'string', isrequired: "是", explicate: '平台秘钥' }, | |||
{ attribute: 'sign', type: 'string', isrequired: "是", explicate: '签名,详见 安全规则=>签名算法' }, | |||
{ attribute: 'sign', type: 'string', isrequired: "是", explicate: '签名,详见 安全规则=>签名算法' } | |||
]; | |||
const requestData = [ | |||
{ attribute: 'code', type: 'string', isrequired: "是", explicate: '物料Code' }, | |||
{ attribute: 'name', type: 'string', isrequired: "是", explicate: '物料名称' }, | |||
{ attribute: 'typeName', type: 'string', isrequired: "是", explicate: '物料类型名称' }, | |||
@@ -107,8 +108,15 @@ const App = () => ( | |||
<blockquote>{" POST http://localhost:5006/api/ExternalPlatform/Material/UpdateMateria"}</blockquote> | |||
</Paragraph> | |||
<Title level={4}>公共请求参数</Title> | |||
HTTP头参数 | |||
<Paragraph> | |||
<Table pagination={{ position: ["none"] }} | |||
columns={requestColumns} dataSource={publicrequestData} /> | |||
</Paragraph> | |||
<Title level={4}>请求参数</Title> | |||
Body | |||
<Paragraph> | |||
<Table pagination={{ position: ["none"] }} | |||
columns={requestColumns} dataSource={requestData} /> | |||
@@ -125,6 +133,12 @@ const App = () => ( | |||
<blockquote>{"示例说明: post请求"}</blockquote> | |||
</Paragraph> | |||
<Title level={4}>公共请求数据示例</Title> | |||
<Paragraph> | |||
<blockquote>{"请求头添加如下信息"}</blockquote> | |||
<pre>{' "key: a92370b8-a633-47e6-9662-7755b8fe9ee4" \r\n "sign: 987DA29D82DE9A65F4DFB986170F5272" '}</pre> | |||
</Paragraph> | |||
<Title level={4}>请求数据示例</Title> | |||
<Paragraph> | |||
<blockquote>{"示例说明: post请求"}</blockquote> | |||
@@ -3,9 +3,9 @@ import { Divider, Typography } from 'antd'; | |||
const { Title, Paragraph, Text, Link } = Typography; | |||
import styles from './index.less'; | |||
var html1= '{ "sign": "string", "key": "string", "code": "string", "name": "string", "typeName": "string", "uintName": "string" }'; | |||
var html2='stringA="Code=string&Key=9A0A8659F005D6984697E2CA0A9CF3B7&Name=string&TypeName=string&UintName=string";'; | |||
var html3='\r\nMD5签名方式:\r\n\r\nstringSignTemp=stringA+"&key=192006250b4c09247ec02edce69f6a2d" //注:key为商户平台设置的密钥key\r\n\r\nsign=MD5(stringSignTemp).toUpperCase()="9A0A8659F005D6984697E2CA0A9CF3B7" //注:MD5签名方式\r\n\r\n'; | |||
var html1= '{ "code": "string", "name": "string", "typeName": "string", "uintName": "string" }'; | |||
var html2='stringA="Code=string&Name=string&TypeName=string&UintName=string";'; | |||
var html3='\r\nMD5签名方式:\r\n\r\nstringSignTemp=stringA+"&key=192006250b4c09247ec02edce69f6a2d" //注:key为商户平台设置的密钥key\r\n\r\nsign=MD5(stringSignTemp)="9A0A8659F005D6984697E2CA0A9CF3B7" //注:MD5签名方式\r\n\r\n'; | |||
const App = () => ( | |||
<Typography> | |||
<Title level={4}>签名算法</Title> | |||
@@ -19,8 +19,6 @@ const App = () => ( | |||
◆ 参数名ASCII码从小到大排序(字典序);<br /> | |||
◆ 如果参数的值为空不参与签名;<br /> | |||
◆ 参数名区分大小写;<br /> | |||
◆ 验证调用返回或微信主动通知签名时,传送的sign参数不参与签名,将生成的签名与该sign值作校验。<br /> | |||
<br /> | |||
第二步,在stringA最后拼接上key得到stringSignTemp字符串,并对stringSignTemp进行MD5运算,再将得到的字符串所有字符转换为大写,得到sign值signValue。 注意:密钥的长度为32个字节。<br /> | |||
<br /> | |||