import baseAxios from './index'

export enum eSmsType {
  registerOrLogin = 1,
  modifyPwd = 2,
}

export default class VerifyCodeService {
  static instance: VerifyCodeService
  static getInstance() {
    if (!VerifyCodeService.instance) {
      VerifyCodeService.instance = new VerifyCodeService()
    }
    return VerifyCodeService.instance
  }

  send(data: { phone: string; smsType: eSmsType }) {
    return baseAxios({
      method: 'post',
      url: '/security/verifycode',
      data,
    })
  }
}
