芝麻web文件管理V1.00
编辑当前文件:/home/pulsehostuk9/public_html/invoicer.pulsehost.co.uk/resources/scripts/plugins/axios.js
import axios from 'axios' import Ls from '@/scripts/services/ls.js' window.Ls = Ls window.axios = axios axios.defaults.withCredentials = true axios.defaults.headers.common = { 'X-Requested-With': 'XMLHttpRequest', } /** * Interceptors */ axios.interceptors.request.use(function (config) { // Pass selected company to header on all requests const companyId = Ls.get('selectedCompany') const authToken = Ls.get('auth.token') if (authToken) { config.headers.common.Authorization = authToken } if (companyId) { config.headers.common['company'] = companyId } return config })