import httpInstance from '@/utils/request.js'

//登录
const getLoginAPI = (username, password) => {
  return httpInstance({
    baseURL: '/user',
    url: '/auth/loginByPwd',
    method: 'POST',
    data: {
      username,
      password
    }
  })
}

const getUserZone = () => {
  return httpInstance({
    baseURL: '/operate',
    url: '/ebikeRegion/getZone',
    method: 'GET',
    data: {}
  })
}

const getUserOperation = () => {
  return httpInstance({
    baseURL: '/operate',
    url: '/ebikeRegion/getOperation',
    method: 'GET',
    data: {}
  })
}


//退出登录
const getLogoutAPI = () => {
  return httpInstance({
    baseURL: '/user',
    url: '/auth/logout',
    method: 'POST',
    data: {}
  })
}

export { getLoginAPI, getUserZone, getUserOperation, getLogoutAPI }
