request.interceptors.request.use(
config => {
if (config.method == 'post') {
config.data = {
...config.data,
_t: Date.parse(new Date()) / 1000
}
} else if (config.method == 'get') {
config.params = {
_t: Date.parse(new Date()) / 1000,
...config.params
}
}
return config
}, function (error) {
return Promise.reject(error)
}
)
网友评论