import fetch from './fetch'

//获取验证码配置
export const captchaConfig = () => fetch('/auth/required-captcha?type=web', {});

//获取是否忘记密码配置
export const passwordRecover = () => fetch('/auth/get-authentication-config', {}, 'POST');

//获取验证码图片
export const captcha = () => fetch('/auth/get-captcha', {}, 'POST');

//登录
export const userLogin = (username, pass, captchaSign, verificationcode, captchaTimestamp) => fetch('/api/auth/login', {
  username: username,
  password: pass,
  captcha: {
    sign: captchaSign,
    captcha: verificationcode,
    timestamp: captchaTimestamp
  }
}, 'POST');

