1.鉴权接口获取accessToken
request({
url: "https://" + nalot.host + ":" + nalot.port + "/iocm/app/sec/v1.1.0/login",
headers: {
"content-type": "application/x-www-form-urlencoded"
},
rejectUnauthorized: false,
method: "POST",
body: str,
agentOptions: {
pfx: fs.readFileSync(nalot.p12),
passphrase: nalot.password,
}
}, function (error, response, body) {
if (!error && response.statusCode == 200) {
resolve(body);
} else {
reject(error)
}
});
agentOptions 需要上传p12证书和密钥,摸索了1天,才找到解决方案
网友评论