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)
  }
)

 

相关文章:

  • 2022-01-14
  • 2021-12-21
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-12-06
  • 2022-02-16
  • 2022-01-28
  • 2021-05-25
  • 2022-12-23
  • 2021-07-12
相关资源
相似解决方案