How to add the axios request interceptor after the end of the http request

you need to request the backend to obtain the token, using the interceptor to bring the token by default.

instance.interceptors.request.use(function (config) {
    //config
    getToken()
        .then((data) => {
            config.headers.Authorization = data;
           
        })
         return config;
   console.log(config)

});
The

getToken function puts token, back through promise, but return does not go out. How should token be set

Aug.17,2021

instance.interceptors.request.use(config => {
      const token = getToken()
      if (token) {
        config.headers.token = token
      }
      return config
    }, error => {
      return Promise.reject(error)
    })
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b35475-2bf79.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b35475-2bf79.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?