angular - 在社交登录反应表单字段上出现错误
问题描述
我正在使用带有反应形式的 Angular。在我的登录页面上,有一个使用 FB 或 Google 帐户登录的选项。但是,一旦用户点击这些选项之一,输入字段就会变得无效并变成红色。这个问题有什么解决办法吗?为什么会这样?
popupWindow(provider: string) {
const fromState = this.store.selectSnapshot<any>((state) => state.userState).data as AccountModel;
const countryCode = fromState && fromState.countryCode || environment.defaultCountryCode;
const dualScreenLeft = window.screenLeft;
const dualScreenTop = window.screenTop;
const width = window.innerWidth ? window.innerWidth : document.documentElement.clientWidth ? document.documentElement.clientWidth : screen.width;
const height = window.innerHeight ? window.innerHeight : document.documentElement.clientHeight ? document.documentElement.clientHeight : screen.height;
const left = ((width / 2) - (600 / 2)) + dualScreenLeft;
const top = ((height / 2) - (500 / 2)) + dualScreenTop;
const url = `${this.baseUrl}/api/Account/SocialExternalLogin?countryCode=${countryCode}&provider=${provider}&response_type=token&client_id=_self`;
const features = `location=0,status=0,scrollbars=yes, width=${600}, height=${500}, top=${top}, left=${left}`;
const newWindow = window.open(url, provider, features);
window['authCompleted'] = (localToken) => {
this.setToken(JSON.stringify(localToken));
this.store.dispatch(new fromAccount.UserAccountDetails());
this.dialog.closeAll();
};
}
解决方案
推荐阅读
- r - 如何在 R 中按日期范围存储数据?
- elixir - 如何用ecto实现双向外键
- node.js - 使用 GraphQL 和 Apollo-client 改变来自 API 的数据以使用 Cloudinary 图像
- python - Python 堆栈数据框
- javascript - 使用不在公共内部的样式文件做出反应 + webfontloader
- java - 从 RecyclerView 移至静态图像
- python - 我可以知道从哪里调用/调用函数吗?
- javascript - 如何编写一个以以下格式提供输出的函数?
- performance - 使用 Webpack@5.x 时 DLL 插件有什么作用吗?
- php - 从 storage/app/public/uploads 显示存储图像的问题