...
|
...
|
@@ -5,8 +5,7 @@ |
|
|
*/
|
|
|
|
|
|
'use strict';
|
|
|
|
|
|
const qs = require('querystring');
|
|
|
const _ = require('lodash');
|
|
|
const md5 = require('md5');
|
|
|
|
|
|
const privateKey = {
|
...
|
...
|
@@ -39,7 +38,13 @@ const packageSort = argument => { |
|
|
* @return {string} 生成的签名字符串
|
|
|
*/
|
|
|
const makeSign = argument => {
|
|
|
return md5(qs.stringify(argument)).toLowerCase();
|
|
|
var qs = [];
|
|
|
|
|
|
_.forEach(argument, function(value, key) {
|
|
|
qs.push(key + '=' + _.trim(value));
|
|
|
});
|
|
|
|
|
|
return md5(qs.join('&')).toLowerCase();
|
|
|
};
|
|
|
|
|
|
// 生成API签名,调用后端接口的时候有私钥校验
|
...
|
...
|
|