验签
用户访问接口前需要对json提交的参数做签名校验
生产环境 参数,域名请找技术支持索要
appKey LHtest 公钥(测试)
appSecret LHtest001 秘钥(测试)
根据提供的appKey和appSecret生成签名sign,同时将appKey和sign一起放在参数中以json/application格式提交
示例
以分页查询为例子,当前只上传ruleId参数,那么需要对appKey,ruleId两个参数加密形成签名sign,如果无上传参数,只要对appKey进行加密即可
https://nc.lianhaikeji.com/esapi/tel/search/page
{
"sign":"2fe1daaa54fde27e77fd973a45a5e4e2",
"appKey":"LHtest",
"ruleId": 1
}
验签生成方式
map.put("appKey","LHtest");
map.put("ruleId","1");
String appSecret = "LHtest001";
TreeMap treeMap = new TreeMap<>(map);
String content = StringUtils.join(treeMap.entrySet(), "&");
content = content + "&appSecret=" + appSecret;
String sign = MD5Util.getMD5String(content).toLowerCase();