import axios from '@/utils/axios'
import { encrypt } from '@/utils/crypto'

export function login(form: any) {
  // 处理逻辑
  const timestamp = new Date().getTime().toString()
  return axios.post('/sys/api/login', {
    secret: timestamp,
    captchaVerification: form.captchaVerification,
    phone: encrypt(timestamp + form.phone),
    password: encrypt(timestamp + form.password)
  })
}

export function forget(form: any) {
  // 处理逻辑
  const timestamp = new Date().getTime().toString()
  return axios.post('/sys/api/forget', {
    secret: timestamp,
    email: encrypt(timestamp + form.email),
    password: encrypt(timestamp + form.password),
    code: encrypt(timestamp + form.code),
    inviteCode: form.inviteCode
  })
}
