import axios from '../api'

export default {
  //一期
  captcha(params) {
    return axios.get('/api/user/captcha', JSON.stringify(params))
  },

  login(params) {
    return axios.post('/api/user/login', params)
  },

  getInfo(params) {
    return axios.get('/api/admin/info', JSON.stringify(params))
  },

  authList(params) {
    return axios.get('/api/admin/authList', JSON.stringify(params))
  },

  logout(params) {
    return axios.get('/api/user/logout', JSON.stringify(params))
  },

  dashboard(params) {
    return axios({
      method: "GET",
      url: '/api/index/dashboard?type='+params.type,
      data: {}
    })
  },

  editPassword(params) {
    return axios.post('/api/user/editPassword',params)
  },
  profile(params) {
    return axios.post('/api/user/profile',params)
  },

  upload(params) {
    return axios({
      method: "POST",
      url: '/api/upload/upload',
      data: params,
      timeout: 1000000,
      headers: {
        'Content-Type': 'multipart/form-data'
      }
    })
  }
}
