📜  如何检查请求方法是一个获取 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:58.077000             🧑  作者: Mango

代码示例1
import axios from 'axios';

const Api = axios.create({
  baseURL: 'https://example/',
});

Api.interceptors.response.use(response => {
  if (response.data.message && response.request._method !== 'GET') {
    console.log(response.data.message);
  }
  return response;
},