How the nuxt project uses the router.push () method in the plug-in axios route interception

how does the nuxt project use the router.push () method in plug-in axios route interception?

  $axios.interceptors.response.use(
    (response) => {
      if (response.data.code === 401) {
        Cookie.remove("token");
        Cookie.remove("username");
        Cookie.remove("login");
         Router.push("/users/login");
      }
      return response;
    },
  );

in this way, router will report an error. How can I correct it?

Sep.01,2021

now, instead of using router.push, directly, we use redirect

.
const { $axios, redirect, error } = obj;
 $axios.interceptors.response.use(
    (response) => {
      if (response.data.code === 401) {
        Cookie.remove('token');
        Cookie.remove('username');
        Cookie.remove('login');
        redirect(true, '/users/login');
      }
      return response;
    },
  );

window.$nuxt.$router.push ('/ login/')

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