vue-admin-webapp icon indicating copy to clipboard operation
vue-admin-webapp copied to clipboard

src/api/index目录下网络请求返回401时,清空token且返回登录页好像错了吧?

Open TomSonghang opened this issue 4 years ago • 0 comments

import store from "@/store"; import router from "@/router"; store.commit("DEL_TOKEN"); router.replace({ path: "/login", query: { redirect: router.currentRouter.fullPath, },
}); //上面是你的处理, store.commit("DEL_TOKEN"); commit提交难道不是应该在actions里面的方法提交的吗?这样也能提交mutations吗? 为何不直接使用你store.dispatch("user/loginOut");这个方法呢? 萌新不懂为何你这样处理,求告知啊

TomSonghang avatar Dec 24 '20 03:12 TomSonghang