<ion-header [translucent]="true">
  <ion-toolbar>
    <ion-title>注册</ion-title>
  </ion-toolbar>
</ion-header>
<ion-content>
  <!-- 用户登录状态 -->
  <ion-card>
    <!-- 未登录 -->
    @if(!currentUser?.id){
    <ion-card-header>
      <ion-card-title>请登录</ion-card-title>
      <ion-card-subtitle>暂无信息</ion-card-subtitle>
    </ion-card-header>
    }
    <!-- 未登录 -->
    @if(currentUser?.id){
    <ion-card-header>
      <ion-card-title
        >{{ currentUser?.get("username") }}
        {{ currentUser?.get("realname") }}</ion-card-title
      >
      <ion-card-subtitle
        >性别:{{ currentUser?.get("gender") || "-" }} 年龄:{{
          currentUser?.get("age") || "-"
        }}</ion-card-subtitle
      >
    </ion-card-header>
    }
    <ion-card-content>
      @if(!currentUser?.id){
      <ion-button expand="block" (click)="signup()">注册</ion-button>
      <ion-button expand="block" (click)="login()">登录</ion-button>
      } @if(currentUser?.id){
      <ion-button expand="block" (click)="editUser()">编辑资料</ion-button>
      <ion-button expand="block" (click)="logout()" color="light"
        >登出</ion-button
      >
      }
    </ion-card-content>
  </ion-card></ion-content
>
