恢复修改

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;
# 前端静态文件路径
location {
alias /usr/share/nginx/html;
location / {
root /usr/share/nginx/html;
try_files $uri $uri/ /index.html;
index index.html;
}

View File

@ -45,7 +45,10 @@ export default {
} else {
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)
},
findPathNum(str, char = "/") {

View File

@ -61,6 +61,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: '/user',
component: Layout,
@ -74,19 +87,6 @@ export const constantRoutes = [
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')
}
this.$store.dispatch("Login", this.loginForm).then(() => {
this.$router.push({ path: "/" }).catch(()=>{})
this.$router.push({ path: this.redirect || "/" }).catch(()=>{})
}).catch(() => {
this.loading = false
if (this.captchaEnabled) {