How does axios set the request header separately for a request?

token is set in the global interceptor.
clipboard.png

token,

clipboard.png
(request for landing page)


Hello, landlord! You can handle this problem based on a specific url logo.

// truefalse
if (config.isToken) {
  
}

or determine whether the token field is included in the config. If not, get it from the storage. If so, simply take the token, in the configuration and set the token to an empty string if you do not want to pass the token,.

if (Object.hasOwnProperty.call(config, 'token')) {

}

... 
Menu