提交 20ffa9e7 authored 作者: 龙菲's avatar 龙菲

修复退出登录后重新登录显示404的问题

上级 a6a2988d
<template>
<el-breadcrumb class="app-breadcrumb" separator="/">
<transition-group name="breadcrumb">
<el-breadcrumb-item v-for="(item,index) in levelList" :key="item.path">
<span v-if="item.redirect === 'noRedirect' || index == levelList.length - 1" class="no-redirect">{{ item.meta.title }}</span>
<a v-else @click.prevent="handleLink(item)">{{ item.meta.title }}</a>
......@@ -35,7 +36,7 @@ export default {
const first = matched[0]
if (!this.isDashboard(first)) {
matched = [{ path: '/index', meta: { title: '首页' }}].concat(matched)
matched = [{ path: '/', meta: { title: '首页' }}].concat(matched)
}
this.levelList = matched.filter(item => item.meta && item.meta.title && item.meta.breadcrumb !== false)
......
......@@ -110,7 +110,7 @@ export default {
})
.then(() => {
this.$store.dispatch("LogOut").then(() => {
location.href = "/index";
location.href = "/";
});
})
.catch(() => {});
......
......@@ -173,9 +173,6 @@ const fileFunction = {
* @param {object} file 文件信息
*/
setFileImg(file, key = 'extendName') {
// debugger
console.log(file, key);
console.log(file[key]);
if (file.isDir === 1) {
// 文件夹
return fileImgMap.get('dir')
......
......@@ -62,19 +62,19 @@ export const constantRoutes = [
component: () => import('@/views/error/401'),
hidden: true
},
// {
// path: '',
// component: Layout,
// redirect: 'index',
// children: [
// {
// path: 'index',
// component: () => import('@/views/index'),
// name: 'Index',
// meta: { title: '首页', icon: 'dashboard', affix: true }
// }
// ]
// },
{
path: '/',
component: Layout,
redirect: 'index',
children: [
{
path: 'index',
component: () => import('@/views/home/index'),
name: 'Index',
meta: { title: '首页', icon: 'dashboard', affix: true }
}
]
},
// ...staticRouters,
{
path: '/user',
......
......@@ -83,7 +83,7 @@ service.interceptors.response.use(res => {
MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', { confirmButtonText: '重新登录', cancelButtonText: '取消', type: 'warning' }).then(() => {
isRelogin.show = false;
store.dispatch('LogOut').then(() => {
location.href = '/index';
location.href = '/';
})
}).catch(() => {
isRelogin.show = false;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论