<ion-header [translucent]="true">
  <ion-toolbar>
    <ion-title>我的</ion-title>
    <ion-buttons slot="start" >
      <ion-back-button text="返回"></ion-back-button>
    </ion-buttons>
  </ion-toolbar>
  
</ion-header>

<ion-content [fullscreen]="true">

  <ion-card>
    <img alt="" src="https://img1.baidu.com/it/u=1810598562,594868061&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500" />
    <ion-card-header>
      <ion-card-title>{{user?.get("username") || '未登录'}}</ion-card-title>
      <ion-card-subtitle *ngIf="!user?.id">请您登陆后继续使用</ion-card-subtitle>
      <ion-card-subtitle *ngIf="user?.id">{{user?.get("name")}}-{{user?.get("gender")}}</ion-card-subtitle>
    </ion-card-header>
 
    <!-- 新增：根据用户状态，显示登录/登出按钮，执行跳转或登出函数 -->
    <ion-button *ngIf="!user?.id" fill="clear" routerLink="/user/login">登录</ion-button>
    <ion-button *ngIf="user?.id" fill="clear" routerLink="/user/edit/info">编辑资料</ion-button>
    <ion-button *ngIf="user?.id" fill="clear" (click)="logout()">登出</ion-button>
  </ion-card>


</ion-content>
