feat:所有接口末尾添加时间戳
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user