import request from "../../common/request"

export default {
  getCode: function () {
    return request({
	  url: "/sys/getCode",
      method: 'get'
    })
  },
  login: function (data) {
    return request({
	  url: "/sys/login",
      method: 'post',
      data: data
    })
  },
  logout: function () {
    return request({
	  url: "/sys/logout",
      method: 'get'
    })
  },
  getLoginPhoneCode (loginForm) {
    return request({
      url: '/sys/user/getLoginPhoneCode',
      method: 'get',
      params: {mobile: loginForm},
    })
  },
  getLoginCodeNumber: function (userName) {
    return request({
      url: "/user/getLoginCodeNumber",
      method: "get",
      params: { userName: userName },
    })
  },
  getPhoneCode (loginForm) {
    return request({
      url: '/sys/user/getPhoneCode',
      method: 'get',
      params: {mobile: loginForm},
    })
  },
  savePwd: function (loginForm) {
    return request({
      url: "/sys/user/saveNewPassword",
      method:"get",
      params:{mobile:loginForm.phoneNumber,code:loginForm.phoneCode,newPassword: loginForm.newPassword},
    })
  },
}
