axios.interceptors.request.use((config) => {
config.headers = { ...config.headers, customHeader: 'ABC' };
return config;
});ESLINT错误:
错误分配给函数参数'config‘的属性
如何正确地分配我的customHeader来配置?
发布于 2022-02-12 21:06:11
试一试
axios.interceptors.request.use((config) => {
return {
...config,
headers: {...config.headers, customHeader: 'ABC" }
};
});发布于 2022-11-09 09:01:55
试一试
axios.interceptors.request.use((config) => {
const newConfig = config;
newConfig.headers.customHeader= "ABC"
return newConfig;
});https://stackoverflow.com/questions/71095267
复制相似问题