利用pnp获取用户的property

//Retrieve Properties of Current User
$pnp.sp.profiles.myProperties.get().then(function(result) {
    props = result.UserProfileProperties.results;
    var propValue = "";
    props.forEach(function(prop) {
        propValue += prop.Key + " - " + prop.Value + "<br/>";
    });
    document.getElementById("sample").innerHTML = propValue;
}).catch(function(err) {
    console.log("Error: " + err);
});
//获取特定人员的property
$pnp.sp.profiles.getPropertiesFor(loginName).then(function(result) {
    var props = result.UserProfileProperties.results;
    var propValue = "";
    props.forEach(function(prop) {
    propValue += prop.Key + " - " + prop.Value + "<br/>";
    });
}).catch(function(err) {
    af.error("Submission failed: " + err);
});
原文地址:https://www.cnblogs.com/learning-life/p/10489725.html