/**
 * 重置密码响应模拟
 */

import type { PasswordResetResponse } from '../admin/user'

// 生成随机临时密码
const generateTempPassword = () => {
  const chars = 'ABCDEFGHJKMNPQRSTUVWXYZabcdefghjkmnpqrstuvwxyz23456789'
  let result = ''
  for (let i = 0; i < 8; i++) {
    result += chars.charAt(Math.floor(Math.random() * chars.length))
  }
  return 'Kpl' + result
}

// 生成过期时间（24小时后）
const generateExpiresAt = () => {
  const now = new Date()
  now.setHours(now.getHours() + 24)
  return now.toLocaleString('zh-CN')
}

const mockData: PasswordResetResponse = {
  tempPassword: generateTempPassword(),
  expiresAt: generateExpiresAt()
}

export default mockData
