|
@@ -8,15 +8,18 @@ import * as Parse from "parse"
|
|
|
})
|
|
|
export class MinePage implements OnInit {
|
|
|
|
|
|
- // 由于Parse.User.current()是随着localStorage变化的属性
|
|
|
- // 为了避免首次复制后用户状态变化,页面不同步,通过get方法实现实时获取
|
|
|
- get user():Parse.User|undefined{
|
|
|
- return Parse.User.current()
|
|
|
- }
|
|
|
constructor() {
|
|
|
+
|
|
|
}
|
|
|
|
|
|
- ngOnInit() {
|
|
|
+ // 由于Parse.User.current()是随着localStorage变化的属性
|
|
|
+ // 为了避免首次复制后用户状态变化,页面不同步,通过get方法实现实时获取
|
|
|
+ user:Parse.User|undefined
|
|
|
+ async ngOnInit() {
|
|
|
+ this.user = await Parse.User.current()
|
|
|
+ setInterval(async ()=>{
|
|
|
+ this.user = await Parse.User.current()
|
|
|
+ },1000)
|
|
|
}
|
|
|
logout(){
|
|
|
Parse.User.logOut();
|