import request from '@/utils/request'
import axios from 'axios'
import { getToken } from '@/utils/auth'

export function index(params){
  return request({
    method:'get',
    url:'/api/admin/policy/index',
    params
  })
}

let config = {
  headers: {
    "Content-Type": "application/x-www-form-urlencoded",
    'Authorization':"Bearer " + getToken()
  }
}
export function store(formData){
  return axios.post(`${process.env.VUE_APP_BASE_API}api/admin/policy/store`,formData,config)
}

export function save(formData){
  return axios.post(`${process.env.VUE_APP_BASE_API}api/admin/policy/save`,formData,config)
}

export function destroy(data){
  return request({
    method:'post',
    url:'/api/admin/policy/destroy',
    data
  })
}
