我直接从文档中取出代码,但它好像完全忽略了回调函数的存在:
var jsforce = require('jsforce');
var conn = new jsforce.Connection({
// you can change loginUrl to connect to sandbox or prerelease env.
loginUrl : 'https://ivytechfoundation--ucidev.my.salesforce.com'
});
conn.login('xxxxxx@ivytech.edu.uci.ucidev', 'xxxxxxxxTOjhPejiRZ1KWox4AmYOPzqu', function(err, userInfo) {
console.error('1');
// if (err) { return console.error(err); }
console.error(err);
console.error(userInfo);
// Now you can get the access token and instance URL information.
// Save them to establish connection next time.
console.log(conn.accessToken);
console.log(conn.instanceUrl);
// logged in user property
console.log("User ID: " + userInfo.id);
console.log("Org ID: " + userInfo.organizationId);
// ...
});有什么想法吗?它永远不会达到'1‘
发布于 2021-05-16 10:56:07
似乎有个bug。我也不能让它工作,但它可以工作:
conn
.login(sfUserName, sfPassword + sfToken)
.then((userInfo) => { // your code herehttps://stackoverflow.com/questions/67323437
复制相似问题