node,npm
npm install yly-nodejs-sdk --save
- 接口类lib/api/*.js,集成了所有的易联云接口
- 配置类config.js
- 授权类oauth_client.js,获取调用凭证AccessToken,每日上限次数20次,24小时后更新次数
- 接口调用类rpc_client.js,可以直接用这个类直接进行接口调用
var yly = require('yly-nodejs-sdk');
var config = new yly.Config({
'cid' : '', //应用id
'secret' : '' //应用秘钥
});
var oauthClient = new yly.OauthClinet(config);
oauthClient.getToken().then(function (res){
if (
res.error != 0 &&
res.error_description != 'success'
) {
throw new Error('failed:' + res.error_description);
}
var tokenData = {
'accessToken' : res.body.access_token,
'refreshToken' : res.body.refresh_token,
};
if (res.body.machine_code != null) {
tokenData.machineCode = res.body.machine_code;
}
console.log(tokenData);
});
var RpcClient = new yly.RpcClient(accessToken, config);
var Print = new yly.Print(RpcClient);
Print.index(machineCode, originId, content).then(function(res){
console.log(res);
});
- Release Date : 2024-05-08
- [Feature] printer/pushswitch api 新增mode字段
- Release Date : 2023-11-01
- Release Date : 2023-10-18
- [Feature]v2更新K8关键词设置接口。
- Release Date : 2023-06-07