What is the reason for $router' of undefined?

there is a requirement:
the backend return status code-999 indicates that the token expires and the front end needs to skip to the login page.

my code:
http.js

    import axios from "axios"
    import Vue from "vue"
    import VueRouter from "vue-router"
    import { Message } from "element-ui";
    import common from "./global.js"
    Vue.use(VueRouter)
    
axios.interceptors.response.use(
    response => {
        //token
        if(response.data.code == -999){
            Message({
                message: ",!",
                type: "warning"
            });
            this.$router.push("/login");
            this.common.delCookie("token");
            this.common.delLocal();
        }
        return response;
    },
    error => {
        Message({
            message: "",
            type: "warning"
        });
        return Promise.reject(error.response.data)
});

prompted "Cannot read property"$router" of undefined"

There is no $router attribute in

this


import router from '@/router';
...
router.push('/login');

who does your this point to


use the axios method to change the this point. Before using the axios method, the cache this pointer


js file does not point to new Vue (), but only in the .vue file points to Vue instance

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