import request from '@/utils/httpRequest'

export default class LoginService {
  getCode () {
    return request({
      url: '/sys/getCode',
      method: 'get'
    })
  }
  login (data) {
    console.log(data)
    return request({
      url: '/sys/login',
      method: 'post',
      data: data
    })
  }
  logout () {
    return request({
      url: '/sys/logout',
      method: 'get'
    })
  }
  getLoginCodeNumber (userName) {
    return request({
      url: '/sys/getLoginCodeNumber',
      method: 'get',
      params: {userName: userName}
    })
  }
  getPhoneCode (mobile) {
    return request({
      url: '/sys/getPhoneCode',
      method: 'get',
      params: {mobile: mobile}
    })
  }
  saveNewPassword (inputForm) {
    return request({
      url: '/sys/saveNewPassword',
      method: 'get',
      params: {mobile: inputForm.phoneNumber, code: inputForm.phoneCode, newPassword: inputForm.newPassword}
    })
  }
}
