diff --git a/src/utils/request.js b/src/utils/request.js index eff9a73..8f90d55 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -34,6 +34,9 @@ service.interceptors.request.use(config => { if (getToken() && !isToken) { config.headers['Authorization'] = 'Bearer ' + getToken() // 让每个请求携带自定义token 请根据实际情况自行修改 } + if(config.contentType) { + config.headers['Content-Type']= config.contentType + } // get请求映射params参数 if (config.method === 'get' && config.params) { if(config.params.poolName){