import {BASE_URL, SERVICES_FILE_MANAGEMENT, SERVICE_PLATFORM_POWER_BASE } from '@/config/serviceSettings.js'

import { ACCESS_TOKEN } from '@/store/mutation-types'
import Vue from 'vue'

const api = {
  //'/api/auth/login'
  Login: BASE_URL+'/auth/login',
  Logout: BASE_URL+'/auth/logout',
  ForgePassword: BASE_URL+'/auth/forge-password',
  Register: BASE_URL+'/auth/register',
  SendSms: BASE_URL+'/account/sms',
  SendSmsErr: BASE_URL+'/account/sms_err',

  // get my info
  UserInfo: SERVICE_PLATFORM_POWER_BASE + '/user/info',
  PlatformSettings: {
    baseUrl: SERVICE_PLATFORM_POWER_BASE
  },
  //图片文件上传接口
  fileProps: {
    baseUrl: SERVICES_FILE_MANAGEMENT,
    uploadFile: SERVICES_FILE_MANAGEMENT + '/file/uploadfile',
    /**获取文件图片 */
    getImages(id) {
      const token = Vue.ls.get(ACCESS_TOKEN)
      return SERVICES_FILE_MANAGEMENT + '/file/view/' + id + '?access_token=' + token
    }
  }
}
export default api
