Service implement api or sdk of 3rd party.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
filesite 5851ed82d5 improve config get 6 months ago
conf aliyun sms send done 7 months ago
test aliyun sms send done 7 months ago
.gitignore aliyun sms test done 7 months ago
LICENSE Initial commit 7 months ago
README.md aliyun sms send done 7 months ago
aliyunSmsClient.js aliyun sms test done 7 months ago
common.js add loki service 6 months ago
package.json aliyun sms send done 7 months ago
router_aliyun.js improve config get 6 months ago
router_loki.js add loki service 6 months ago
server.js add loki service 6 months ago

README.md

service-3rd

Service implement api or sdk of 3rd party.

实现第三方平台接口的公用服务,通过API调用。

已对接功能

  • 阿里云的短信发送接口

接口参数签名方法

将所有参数按字母排序之后转换成JSON字符串(注意需保持斜杠/和unicode字符串不转义),最后再拼接上token计算MD5值。

示例如下:

var token = 'hello world';        //config.js里配置的密钥
var params = {                    //参数示例
    "b": 2,
    "a": 1,
    "t": 234343
};

var sortObj = function(obj) {     //参数排序方法
    return Object.keys(obj).sort().reduce(function(result, key) {
        result[key] = obj[key];
        return result;
    }, {});
};

//1. 排序参数
var sortedParams = sortObj(params);
//2. 计算MD5值
var sign = md5( JSON.stringify(sortedParams) + token );