npm i ral-request -S
ral reponse like:
{
status: 0, //0 is ok other error
msg: 'ok', //status desc
data: [], success data
}
ral.request('bind_device', {
data: {
data: {}, // post body
},
headers: {
saiyalogid: logid, //http header
},
query: {
dumi_id: userInfo.dumi_uid, //url query
}
});
}).then(function() {
console.log('[avs]directives bind finish');
}).catch(function(error) {
console.log(error);
});
response data:
{
status: 0,
msg:"ok",
data: {}
}
初始化ral配置, example ral.initRal(require('yog-ral'))
resovle return data; if status !=0 reject
resolve response body(json) ignore status check
The MIT License