| | |
| | | /* //POST传参序列化(添加请求拦截器) */ |
| | | Axios.interceptors.request.use( |
| | | config => { |
| | | console.log(9898); |
| | | console.log(config); |
| | | |
| | | |
| | | if ( |
| | | config.method === "post" && |
| | | sessionStorage.getItem('clusterId') || |
| | |
| | | if(typeof config.data == 'object' ) { |
| | | config.data.clusterId = sessionStorage.getItem('clusterId') |
| | | config.data.devId = sessionStorage.getItem('devId') |
| | | } |
| | | |
| | | if(config.url === '/saas/api-s/camera/rule/getLinkRulesByCameraIds') { |
| | | config.data.devId = sessionStorage.getItem('cameraDevId') |
| | | } |
| | | |
| | | //后门 |
| | | if(config.url === '/saas/api-d/device/userClusterInfo') { |
| | | config.data.clusterId = '' |
| | | } |
| | | |
| | | if(config.url === '/saas/api-s/es/saveEsConfig') { |
| | | delete config.data.clusterId |
| | | delete config.data.devId |
| | | } |
| | | |
| | | } |
| | |
| | | // window.sessionStorage.setItem('policeCameravideoIsLoginTimeout', JSON.stringify(true)) |
| | | // } |
| | | |
| | | var disposition = res.headers["content-disposition"]; |
| | | if(disposition) { |
| | | var fileName = disposition.substring(disposition.indexOf("=") + 1); |
| | | console.log(res); |
| | | |
| | | return { |
| | | fileName:fileName, |
| | | body:res |
| | | } |
| | | } |
| | | |
| | | return res.data ? res.data : {} |
| | | |
| | |
| | | return Promise.reject(errJson) |
| | | } |
| | | ) |
| | | |
| | | Axios.defaults.timeout = 10000 |
| | | export default Axios |