移除本地缓存用户信息

This commit is contained in:
禾几海
2020-05-19 17:44:04 +08:00
parent 00f69509c3
commit f8d3494626
8 changed files with 113 additions and 86 deletions

View File

@@ -30,6 +30,7 @@ export class AdminDashboardComponent implements OnInit {
dayVisitCount: number = 0;
userInfo: User = new User();
private isRequested: boolean = false;
ngOnInit(): void {
}
@@ -52,13 +53,14 @@ export class AdminDashboardComponent implements OnInit {
getUserInfo = () => this.userService.watchUserInfo({
next: data => {
this.userInfo = data.result
if (data.result && data.result.role === 'admin') {
if (data.result && data.result.role === 'admin' && !this.isRequested) {
this.getLog();
this.getCounts();
this.isRequested = true;
this.getDayVisitCount();
}
},
error: null,
complete: null
error: () => null,
complete: () => null
})
}