/**
 * 注册
 */
export type RegisterForm = {
  tenantId: string;
  username: string;
  password: string;
  confirmPassword?: string;
  code?: string;
  uuid?: string;
  userType?: string;
};

/**
 * 登录请求
 */
export interface LoginData {
  tenantId?: string;
  username?: string;
  password?: string;
  rememberMe?: boolean;
  socialCode?: string;
  socialState?: string;
  source?: string;
  code?: string;
  uuid?: string;
  clientId: string;
  grantType: string;
  faceAuthVerified?: boolean;
  faceAuthQrCodeId?: string;
  // 新增：双因子验证相关字段
  twoFactorCode?: string;
  twoFactorId?: string;
}

/**
 * 登录响应
 */
export interface LoginResult {
  access_token: string;
  expireIn: number;
  refreshToken?: string;
  clientId: string;
  loginStatus: number; // 0-登录成功, 1-需要人脸识别, 2-需要双因子验证
  faceAuthQrCodeId?: string;
  // 新增：双因子验证相关字段
  twoFactorId?: string;
  userEmail?: string; // 用于显示脱敏邮箱
  message: string;
}

/**
 * 验证码返回
 */
export interface VerifyCodeResult {
  captchaEnabled: boolean;
  uuid?: string;
  img?: string;
}

/**
 * 租户
 */
export interface TenantVO {
  companyName: string;
  domain: any;
  tenantId: string;
}

export interface TenantInfo {
  tenantEnabled: boolean;
  voList: TenantVO[];
}

// 定义SSO登录数据类型
export interface SsoLoginData {
  tenantId: string;
  user: string;
  time: string;
  token: string;
}
