How to add token to the axios request method every time

I use ordinary html pages to load data through axios. After logging in to login.html, get the token. on the server side. This token. should be carried on the requested header of all subsequent pages.
after logging in successfully, I set axios.defaults.headers.common ["Authorization"] = "AUTH_TOKEN" in login.html;
but when it comes to other pages, the Authorization of axios"s header is undefined,. What should I do to ensure that all requests are automatically accompanied by this token?

?
Feb.28,2021

  1. variables must not span pages.
  2. A scheme in which data can also be saved across pages, such as cookie, localStorage, URL variable passing, and so on.

Please use axios's interceptor

// http request 
axios.interceptors.request.use(
    config => {
        if (store.state.token) {  // tokenhttp headertoken
            config.headers.Authorization = `token ${store.state.token}`;
        }
        return config;
    },
    err => {
        return Promise.reject(err);
    });

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