恢复修改

This commit is contained in:
MerCry 2026-02-10 03:26:46 +08:00
parent 85efb6f0e3
commit 1220e38d38
4 changed files with 20 additions and 17 deletions

View File

@ -3,8 +3,8 @@ server {
server_name localhost; server_name localhost;
# 前端静态文件路径 # 前端静态文件路径
location { location / {
alias /usr/share/nginx/html; root /usr/share/nginx/html;
try_files $uri $uri/ /index.html; try_files $uri $uri/ /index.html;
index index.html; index index.html;
} }

View File

@ -45,7 +45,10 @@ export default {
} else { } else {
matched = router.matched.filter(item => item.meta && item.meta.title) matched = router.matched.filter(item => item.meta && item.meta.title)
} }
//
if (!this.isDashboard(matched[0])) {
matched = [{ path: "/index", meta: { title: "首页" } }].concat(matched)
}
this.levelList = matched.filter(item => item.meta && item.meta.title && item.meta.breadcrumb !== false) this.levelList = matched.filter(item => item.meta && item.meta.title && item.meta.breadcrumb !== false)
}, },
findPathNum(str, char = "/") { findPathNum(str, char = "/") {

View File

@ -61,6 +61,19 @@ export const constantRoutes = [
component: () => import('@/views/error/401'), component: () => import('@/views/error/401'),
hidden: true hidden: true
}, },
{
path: '',
component: Layout,
redirect: 'index',
children: [
{
path: 'index',
component: () => import('@/views/index'),
name: 'Index',
meta: { title: '首页', icon: 'dashboard', affix: true }
}
]
},
{ {
path: '/user', path: '/user',
component: Layout, component: Layout,
@ -74,19 +87,6 @@ export const constantRoutes = [
meta: { title: '个人中心', icon: 'user' } meta: { title: '个人中心', icon: 'user' }
} }
] ]
},
{
path: '/',
component: Layout,
redirect: '/index',
children: [
{
path: 'index',
component: () => import('@/views/index'),
name: 'Index',
meta: { title: '首页', icon: 'dashboard', affix: true }
}
]
} }
] ]

View File

@ -144,7 +144,7 @@ export default {
Cookies.remove('rememberMe') Cookies.remove('rememberMe')
} }
this.$store.dispatch("Login", this.loginForm).then(() => { this.$store.dispatch("Login", this.loginForm).then(() => {
this.$router.push({ path: "/" }).catch(()=>{}) this.$router.push({ path: this.redirect || "/" }).catch(()=>{})
}).catch(() => { }).catch(() => {
this.loading = false this.loading = false
if (this.captchaEnabled) { if (this.captchaEnabled) {