Vue axios cannot initiate a request in the Wechat browser of some mobile phones.

there is no response from axios get or post, and there is no output from then or catch. Other browsers on the same phone are (UC), and Wechat debugging tools, PC browsers, local environment, and chrome simulation of Wechat are all fine.

my phone is Xiaomi 8, not even my colleague"s Android, but another colleague"s iphone.

the last one on Baidu said that Wechat"s browser cache problem, which has been tried but has not been solved. I suspect that some of the ES6 code has not been converted, resulting in some syntax not being executed?

have you ever met.

axios v0.17.1
vue 2.5.2

Update

add polyfill.js to package and launch, refresh will not work. Clear the cache to change the account number, OK. I don"t know if it will happen again.


maybe those browsers do not support Promise


why not compile the code with polyfill.js and try


 headers config.headers['If-Modified-Since'] = '0'




axios.interceptors.request.use((config) => {
  config.headers['If-Modified-Since'] = '0'
  const token = localStorage.getItem('TOKEN')
  if (config.contentType === 'form-data') {
    config.data = makeFormData(config.data)
  }

  return config
}, (error) => {
  return Promise.reject(error)
})
Menu