Tay*_*tin 0 javascript firebase
我正在尝试做类似的事情:
firebase.auth().currentUser.updateProfile({displayName: 'test'})
.then(user => {
console.log(user);
})
.catch(err => {
console.log(err);
}
Run Code Online (Sandbox Code Playgroud)
但是控制台用户什么也没显示。它不会在承诺中返回任何内容吗?
updateProfile返回非null的firebase.Promise包含void一个例子:
Run Code Online (Sandbox Code Playgroud)// Updates the user attributes: user.updateProfile({ displayName: "Jane Q. User", photoURL: "https://example.com/jane-q-user/profile.jpg" }).then(function() { // Profile updated successfully! // "Jane Q. User" var displayName = user.displayName; // "https://example.com/jane-q-user/profile.jpg" var photoURL = user.photoURL; }, function(error) { // An error happened. }); // Passing a null value will delete the current attribute's value, but not // passing a property won't change the current attribute's value: // Let's say we're using the same user than before, after the update. user.updateProfile({photoURL: null}).then(function() { // Profile updated successfully! // "Jane Q. User", hasn't changed. var displayName = user.displayName; // Now, this is null. var photoURL = user.photoURL; }, function(error) { // An error happened. });
| 归档时间: |
|
| 查看次数: |
445 次 |
| 最近记录: |