import request from '@/utils/request';
import { AxiosPromise } from 'axios';

/**
 * 检查人脸识别状态
 * @param qrCodeId 二维码ID
 */
export function checkFaceAuthStatus(qrCodeId: string): AxiosPromise<boolean> {
  return request({
    url: '/auth/face/status',
    method: 'post',
    data: { qrCodeId }
  });
}

/**
 * 初始化人脸识别
 * @param userId 用户ID
 * @param tenantId 租户ID
 */
export function initFaceAuth(userId: string, tenantId: string): AxiosPromise<string> {
  return request({
    url: '/auth/face/init',
    method: 'post',
    params: { userId, tenantId }
  });
}

/**
 * 获取人脸识别二维码Base64数据
 * @param qrCodeId 二维码ID
 */
export function getFaceAuthQrCodeBase64(qrCodeId: string): AxiosPromise<any> {
  return request({
    url: '/auth/face/qrcode',
    method: 'post',
    data: { qrCodeId }
  });
}
