const powerService = '/api/service-platform-power-base'
const filePropsBaseUrl = '/api/service-filemanagement'
const oms = '/api/upcloud-base-chain'

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

const api = {
  //'/api/auth/login'
  Login: '/api/auth/login',
  Logout: '/api/auth/logout',
  ForgePassword: '/api/auth/forge-password',
  Register: '/api/auth/register',
  SendSms: '/api/account/sms',
  SendSmsErr: '/api/account/sms_err',
  // get my info
  UserInfo: powerService + '/user/info',
  PlatformSettings: {
    baseUrl: powerService
  },
  //图片文件上传接口
  fileProps: {
    baseUrl: filePropsBaseUrl,
    uploadFile: filePropsBaseUrl + '/file/uploadfile',
    /**获取文件图片 */
    getImages(id) {
      const token = Vue.ls.get(ACCESS_TOKEN)
      return filePropsBaseUrl + '/file/view/' + id + '?access_token=' + token
    }
  },
  enterprise: {
    baseUrl: powerService,
    list: powerService + '/enterprise/search',
    pwdReset: '/api/service-platform-power-base/userpower/updatePassword' // 企业用户密码重置
  },
  //仓配物流基础
  warehouseBase: {
    baseUrl: '/api/upcloud-wms-base'
  },
  // 获取商品资料 品类
  goods: {
    detail: '/api/upcloud-base-item/item/master/info',
    category: '/api/upcloud-base-item/item/category/query',
    levelAdd: '/api/upcloud-base-item/item/category/add',
    levelEdit: '/api/upcloud-base-item/item/category/edit',
    levelDel: '/api/upcloud-base-item/item/category/del',

    dataAdd: '/api/upcloud-base-item/item/master/add', // 新增商品资料
    dataEdit: '/api/upcloud-base-item/item/master/edit' // 修改商品资料
  },
  // 供应商
  supplier: {
    add: '/api/upcloud-base-chain/suppliermst/add', // 新增供应商
    edit: '/api/upcloud-base-chain/suppliermst/update', // 修改供应商
    detail: '/api/upcloud-base-chain/suppliermst' // 获取供应商详情
  },
  // 客户
  customer: {
    add: '/api/upcloud-base-chain/customermst/add', // 新增客户
    edit: '/api/upcloud-base-chain/customermst/update', // 修改客户
    detail: '/api/upcloud-base-chain/customermst' // 获取供应商详情
  },
  // 货主
  shipper: {
    add: '/api/upcloud-base-chain/cargoownermst/add', // 新增货主
    edit: '/api/upcloud-base-chain/cargoownermst/update', // 修改客户
    detail: '/api/upcloud-base-chain/cargoownermst' // 获取供应商详情
  },
  OMS: {
    baseUrl: oms
  }
}
export default api
