Can axios configure public params?

if the question belongs to
I have three fields that must be added to all requests and must be placed in params
now what I want to ask is does axios have a way to configure these three fields as common parameters
Thank you all for answering

first.
Mar.03,2021

const requestBefore = (config) = > {
config. Params = {

//

};
return config;
}

axios.interceptors.request.use (requestBefore);


just add it to the interceptor


you can take a look at "

  1. transformRequest add
axios.defaults.transformRequest = [function(data) {
    ...
}];

2. Add

to the interceptor

axios interceptor (you can also use this as a loading. before each request) attach a link link description

service.interceptors.request.use( 
  config => {
    // token token
    const USER_TOKEN = JSON.parse(sessionStorage.getItem('user')) && JSON.parse(sessionStorage.getItem('user')).USER_TOKEN
    // token,
    if(USER_TOKEN && !config.url.includes('login')){
      config.headers.common['USER_TOKEN'] = USER_TOKEN
    }
    return config
  },
  err => {
    return Promise.reject(err)
  }
)

what I answered before is more or less the same. You can take a look at

.
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-1b363c5-2ad40.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-1b363c5-2ad40.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?