common.js 2.22 KB
/*
 * @Author: yangming yangming@didihu.com.cn
 * @Date: 2022-11-23 14:46:30
 * @LastEditors: 前端 qianduan01@didihu.com.cn
 * @LastEditTime: 2022-12-18 14:49:23
 * @FilePath: \live\src\api\modules\common.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import { http_common, http } from '@/main'
const defaultPath = 'scrm.api.carlife.'
const pictureUpload = params => {
  params.method = 'glsx.accounts.biz.common.pictureUpload'
  return http_common({
    url: '/router?method=glsx.accounts.biz.common.pictureUpload',
    method: 'POST',
    data: params,
    sign: true,
    noSignAttr: ['file']
  })
}
// 根据门店号获取员工列表
const getMerchantStaff = params => {
  params.method = 'scrm.api.shopmall.crowd.funding.staff.get'
  return http({
    url: '/rop-scrm-shopmall/router',
    method: 'POST',
    data: params,
    sign: true
  })
}
const getMerchantList = params => {
  params.method = `${defaultPath}merchant.listWithPageByCurMerchant`
  return http({
    url: 'rop-scrm-carlife/router',
    method: 'POST',
    data: params,
    sign: true
  })
}
const uploadImgApi = params => {
  params.method = `${defaultPath}common.uploadImg`
  return http({
    url: 'rop-scrm-carlife/router',
    method: 'POST',
    data: params,
    sign: true,
    noSignAttr: ['file']
  })
}
const uploadMusicApi = params => {
  params.method = 'scrm.api.carlife.common.uploadMusic'
  return http({
    url: 'rop-scrm-carlife/router',
    method: 'POST',
    data: params,
    sign: true,
    noSignAttr: ['file']
  })
}
const uploadVideoApi = params => {
  params.method = `${defaultPath}common.uploadVideo`
  return http({
    url: 'rop-scrm-carlife/router',
    method: 'POST',
    data: params,
    sign: true,
    noSignAttr: ['file']
  })
}
const uploadFundingVideoApi = params => {
  params.method = 'scrm.api.carlife.crowd.funding.uploadVideo'
  return http({
    url: 'rop-scrm-carlife/router',
    method: 'POST',
    data: params,
    sign: true,
    noSignAttr: ['file']
  })
}
export default {
  pictureUpload,
  getMerchantStaff,
  getMerchantList,
  uploadImgApi,
  uploadMusicApi,
  uploadVideoApi,
  uploadFundingVideoApi
}