提交 dfd61e8c 编写于 作者: Mr.奇淼('s avatar Mr.奇淼(

修复了登陆时首页蓝点未点亮的bug

上级 d8eb3ed9
......@@ -5,7 +5,6 @@ import getPageTitle from '@/utils/page'
let asyncRouterFlag = 0
const whiteList = ['login']
router.beforeEach(async(to, from, next) => {
const token = store.getters['user/token']
// 在白名单中的判断情况
......
......@@ -24,8 +24,8 @@ export const user = {
LoginOut(state) {
state.userInfo = {}
state.token = ""
router.push({ name: 'login', replace: true })
sessionStorage.clear()
router.push({ name: 'login', replace: true })
window.location.reload()
},
ResetUserInfo(state, userInfo = {}) {
......@@ -43,12 +43,13 @@ export const user = {
await dispatch('router/SetAsyncRouter', {}, { root: true })
const asyncRouters = rootGetters['router/asyncRouters']
router.addRoutes(asyncRouters)
const redirect = router.history.current.query.redirect
if (redirect) {
router.push({ path: redirect })
} else {
// const redirect = router.history.current.query.redirect
// console.log(redirect)
// if (redirect) {
// router.push({ path: redirect })
// } else {
router.push({ name: getters["userInfo"].authority.defaultRouter })
}
// }
return true
}
},
......
......@@ -43,7 +43,6 @@ export default {
rightActive: ""
};
},
computed: {
...mapGetters("user", ["userInfo"]),
defaultRouter() {
......@@ -69,7 +68,11 @@ export default {
];
this.historys =
JSON.parse(sessionStorage.getItem("historys")) || initHistorys;
this.activeValue = window.sessionStorage.getItem("activeValue");
if(!window.sessionStorage.getItem("activeValue")){
this.activeValue = this.$route.name + JSON.stringify(this.$route.query)+JSON.stringify(this.$route.params)
}else{
this.activeValue = window.sessionStorage.getItem("activeValue");
}
this.setTab(this.$route);
},
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册