【发布时间】:2021-03-29 04:28:06
【问题描述】:
如果用户已经登录,我想收到电子邮件声明。
this.auth.idTokenClaims$.forEach(e => console.log(">>>>>>>>>>>>>"+e.email));
正在打印电子邮件
我想写这样的东西(因为 e 可以为空)
if((this.auth.isAuthenticated$ | async) === false){
this.auth.idTokenClaims$.forEach(e => {
this.cService.dash(e.email).subscribe(
data => { this.yeah = data},
err => console.error(err),
() => console.log('Main Content ')
)}
);
} else {
this.cService.dash(null).subscribe(
data => { this.yeah = data},
err => console.error(err),
() => console.log('Main Content from else '));
}
问题: if((this.auth.isAuthenticated$ | async) === false){
它说总是评估为假,因为
此条件将始终返回 'false',因为类型 'number' 和 'boolean' 没有重叠。ts(2367)
或
算术运算的左边必须是'any'类型, 'number'、'bigint' 或枚举类型.ts(2362)
这几行
谁能帮我解决这个问题
【问题讨论】: