📜  axios 拦截器 - Javascript 代码示例

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

代码示例3
axios.interceptors.request.use((value) => {
        value.headers = {
            'Access-Control-Allow-Origin': '*',
            'Access-Control-Allow-Methods': '*',
            'Access-Control-Allow-Headers': '*',
            'Accept': 'application/json',
            'Content-Type': 'application/json'
        }
        return value
    })