点击登录token存储后进行跳转报如下错误
开始跳转采用 $router.replace(“/”) 进行重定向 如下代码
async login() {
// 网络请求
let data = await login(this.account);
let token = data.token;
// 本地 vuex
this.$store.commit('LOGIN_IN',token);
this.$router.replace("/")
}
后来跳转采用 $router.push(“/”) 进行跳转 如下代码
async login() {
// 网络请求
let data = await login(this.account);
let token = data.token;
// 本地 vuex
this.$store.commit('LOGIN_IN',token);
this.$router.push("/")
}
报错消失 原因待寻找