我需要获取登录用户的数据。我使用firebase.auth().onAuthStateChanged查看用户是否已登录,然后对返回的userData执行console.log操作。
它返回所有用户的数据,如下所示,但我找不到如何检索它。我可以检索userData.email、userData.fullname和userData.uid,我知道它们来自授权,但其他数据在那里。我知道我可以使用uid来读取数据,但是它已经存在了。
如果有人能帮助我,我将不胜感激。
确认:“新”邮箱:“yakr@uacro.com”全名:“john Varified”工资类型:“d”registrationDate:"Sat Sep 23 2017“主题:”grey“uid:"FWOb7eJ38veRXQ7wadk77YzhyMj1”
发布于 2017-09-24 06:21:19
多亏了Udemy.com上的必修课,我找到了我缺失的一环。我需要一个服务来设置和销毁本地镜像。
export class User2memoryService {
constructor() {}
set(userFromDb) {
localStorage.setItem('user', JSON.stringify(userFromDb));
}
destroy() {
localStorage.removeItem('user');
}
}https://stackoverflow.com/questions/46376576
复制相似问题