Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

Rev 7394 | Rev 7396 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 7394 Rev 7395
Línea 26... Línea 26...
26
  })
26
  })
27
}
27
}
Línea 28... Línea 28...
28
 
28
 
29
axios.all = Axios.all
29
axios.all = Axios.all
-
 
30
axios.spread = Axios.spread
30
axios.spread = Axios.spread
31
 
31
axios.upload = (url, data) => {
32
axios.upload = (url, data) => {
32
  return axios.post(url, new FormData(data), {
33
  return axios.post(url, new FormData(data), {
33
    headers: {
34
    headers: {
34
      'Content-Type': 'multipart/form-data',
35
      'Content-Type': 'multipart/form-data',
35
    },
36
    },
36
  })
37
  })
Línea 37... Línea 38...
37
}
38
}
38
 
39
 
-
 
40
axios.interceptors.request.use(
-
 
41
  async (request) => {
39
axios.interceptors.request.use(
42
    request.headers.ORIGIN = window.location.host
40
  async (request) => {
43
 
41
    if (['post', 'put', 'delete'].includes(request.method)) {
44
    if (['post', 'put', 'delete'].includes(request.method)) {
42
      try {
45
      try {
43
        const resp = await axios.get('/csrf')
46
        const resp = await axios.get('/csrf')