feat:所有接口末尾添加时间戳

This commit is contained in:
zhangyu
2020-10-22 15:38:40 +08:00
parent 5099ef90b9
commit 3728f95b7d

View File

@@ -12,13 +12,21 @@ axios.interceptors.request.use(config => {
// "Content-Type": 'application/x-www-form-urlencoded',
// }
// config.data = qs.stringify(config.data);
let token = sessionStorage.getItem('nz-token')
let token = sessionStorage.getItem('nz-token');
if (token) {
config.headers['Authorization'] = token //请求头token
}
return config;
},
err => Promise.reject(err)
config.headers['Authorization'] = token //请求头token
}
config.data={
...(config.data||{}),
_t:new Date().getTime(),
};
config.params={
...(config.params||{}),
_t:new Date().getTime(),
};
return config;
},
err => Promise.reject(err)
);
const accountErrorCode = [518003, 518004, 518005, 518006, 518007, 518008]; //账号锁定等
axios.interceptors.response.use(