angular - 将所有用户从 firebase 获取到自己的后端
问题描述
我正在尝试将 google login+firebase 用于我的 ionic 4 应用程序,所有用户都在 firebase 中,但我可以将用户信息获取到我自己的后端吗?我的意思是我还为我构建了管理面板,以显示我在离子应用程序中获得的所有信息也显示在我的管理面板中。
这是我的代码:
login() {
this.googlePlus.login({
webClientId : '927898787134-spvfdmvm9apq0e1fo2efvvura8vqpid8.apps.googleusercontent.com',
offline : true
}).then(res => {
firebase.auth().signInWithCredential(firebase.auth.GoogleAuthProvider.credential(res.idToken))
.then(suc => {
// console.log('users', JSON.stringify(suc));
this.httpwelcome.post('https://mobile.youthscarf.id/ionic/login_data.php', { userData: res.userData, user: res.user, displayName: res.displayName, email: res.email}).subscribe((response) => {
console.log(response);
console.log(JSON.stringify(response));
});
localStorage.setItem('user', JSON.stringify(suc));
}).catch(ns => {
console.log('Unsucessful');
});
});
}
我试图使用 http post,但似乎无法正常工作。任何人都知道如何实现这一目标?
解决方案
推荐阅读
- authentication - 有哪些工具和方法可以为 Windows 自定义凭据提供程序编写自动化测试?
- javascript - 为什么 Firefox 显示“递归过多”错误?
- android - FirestoreRecycler 选项。当不需要索引时,查询需要索引错误。只有当我使用 orderBy
- html - 在不同的断点处使用相同的 SVG 时,SVG 线性渐变会损坏
- python - How to interact with a python file's objects methods (putting inputs, alterting data, and getting outputs ) from the command line?
- post - Google Sheets to Salesforce with OAuth2 - Question about post mapping
- c# - VS告诉我“名称'xxx'在当前上下文中不存在”无论容器数据类型如何,即使我刚刚初始化它
- r - 粘贴和折叠矢量并用引号括起来
- python - 如何使用 Selenium 和 Python 将 AppleID 发送到登录字段
- spring-boot - Log4J2 的 Spring Boot 查找不起作用