import { axios } from '@archser/layout-ui'
import myaxios from 'axios'

const SERVICE_URL = '/aserver'
/**
 * 获取所有系统
 */
export const getSettings = () => {
  return axios.get('/aserver/setting/all')
}

export const add = config => {
  return axios.request({
    url: SERVICE_URL + '/setting/add',
    data: config,
    method: 'post'
  })
}

export const dele = data => {
  return axios.request({
    url: SERVICE_URL + '/setting/dele',
    data,
    method: 'post'
  })
}

export const findConfigList = (params) => {
  return axios.request({
    url: SERVICE_URL + '/setting/findConfigList',
    params: params,
    method: 'post'
  })
}

/**
 * Liukexin 20200930 更改系统名称和图标
 * @param {*} param 
 */
export const changeSetting = param => {
  return myaxios({
    url: SERVICE_URL + '/setting/changeSetting',
    method: 'post',
    data: param,
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  })
}
