Why axios.interceptors executed twice.

Why did axios.interceptors execute it twice

 
 new Vue({
    router,
    store,
    created() {
      Vue.prototype.$http = axios;
      this.$http.interceptors.response.use(response => {
        console.log("-----")
                return response.data
            }, error => {
                if (error && error.response && error.response.status == "401") {
          this.$cookies.remove("userName");
          this.$cookies.remove("token");
          //router
          this.$router.options.routes = [];
                    this.$router.push({ path: "/login" });
                }
                return Promise.reject(error)
      });
      if (VueCookies.get("token")) {
        axios.defaults.headers["Authorization"] = VueCookies.get("token");
        store.dispatch("UpdateMenu");
      } else {
        this.$cookies.remove("userName");
        this.$cookies.remove("token");
        //router
        this.$router.options.routes = [];
        this.$router.push({ path: "/login" });
      }
    },
    render: h => h(App)
  }).$mount("-sharpapp");

printed two lines of "-". Axios.interceptors is not set elsewhere

Mar.20,2021

I also came across, preliminary discovery, due to the re-registration of this interceptor.


I have also encountered it now. The main reason for the skull pain data functions should return an object is that it can not find the reason why it is triggered twice

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