diff --git a/.env.development b/.env.development index 0042ee8..317a6be 100644 --- a/.env.development +++ b/.env.development @@ -26,9 +26,9 @@ VITE_APP_SNAILJOB_ADMIN='http://192.168.1.215/snail-job' VITE_APP_PORT=5174 -# 登录成功跳转地址(/index → 统计汇总首页) +# 登录成功跳转地址(统计汇总首页) # VITE_LOGIN_BACK_URL = '/equipment/WaterDevice' -VITE_LOGIN_BACK_URL='/index' +VITE_LOGIN_BACK_URL='/statistics/statistics-summary' # 地图类型 天地图 WGS84 高德地图 GCJ02, 高德地图 需要在高德地图官网申请key VITE_APP_MAP_TYPE='WGS84' diff --git a/.env.production b/.env.production index b0cdbe3..7a846c5 100644 --- a/.env.production +++ b/.env.production @@ -18,9 +18,9 @@ VITE_APP_SNAILJOB_ADMIN='/snail-job' # VITE_APP_BASE_API = 'https://wuyeapi.bugtc.com' VITE_APP_BASE_API='https://wuyeapi.ckdzkj.com' #VITE_APP_BASE_API='http://192.168.1.198' -# 登录成功跳转地址(/index → 统计汇总首页) +# 登录成功跳转地址(统计汇总首页) # VITE_LOGIN_BACK_URL = '/equipment/WaterDevice' -VITE_LOGIN_BACK_URL='/index' +VITE_LOGIN_BACK_URL='/statistics/statistics-summary' # 地图类型 天地图 WGS84 高德地图 GCJ02, 高德地图 需要在高德地图官网申请key VITE_APP_MAP_TYPE='GCJ02' diff --git a/src/layout/components/TagsView/index.vue b/src/layout/components/TagsView/index.vue index e4a5466..22c26c5 100644 --- a/src/layout/components/TagsView/index.vue +++ b/src/layout/components/TagsView/index.vue @@ -82,7 +82,7 @@ const isAffix = (tag: RouteLocationNormalized) => { }; const isFirstView = () => { try { - return selectedTag.value.fullPath === '/index' || selectedTag.value.fullPath === visitedViews.value[1].fullPath; + return selectedTag.value.fullPath === '/statistics/statistics-summary' || selectedTag.value.fullPath === visitedViews.value[1].fullPath; } catch (err) { return false; } diff --git a/src/permission.ts b/src/permission.ts index a074a58..e33ed60 100644 --- a/src/permission.ts +++ b/src/permission.ts @@ -101,7 +101,7 @@ router.beforeEach(async (to, from) => { isDynamicRoutesAdded = true; // 动态路由已构建完成,重新触发本次导航 - // 登录后不再强制进入小区选择页,直接进入目标页(默认走 '/' 的 redirect → 工作台 /index) + // 登录后不再强制进入小区选择页,直接进入目标页(默认走 '/' 的 redirect → /statistics/statistics-summary) // 这里replace仅在首次加载路由时执行;后续菜单切换不会走到这里 return { ...to, replace: true }; } diff --git a/src/router/index.ts b/src/router/index.ts index 396a3ad..127ef60 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -78,17 +78,14 @@ export const constantRoutes: RouteRecordRaw[] = [ { path: '', component: Layout, - // redirect: '/index', redirect: import.meta.env.VITE_LOGIN_BACK_URL, - // redirect: '/equipment/WaterDevice', children: [ - // { - // path: '/index', - // component: () => import('@/views/workbench/index2.vue'), - // name: 'Index', - // // hidden: true, - // meta: { title: '工作台', icon: 'dashboard', affix: true } - // } + // 旧首页地址兼容:/index 重定向到统计汇总 + { + path: '/index', + redirect: '/statistics/statistics-summary', + hidden: true + } ] } ]; @@ -96,9 +93,9 @@ export const constantRoutes: RouteRecordRaw[] = [ { const homeRoute = constantRoutes.find((item) => item.path === ''); homeRoute?.children?.push({ - path: '/index', + path: '/statistics/statistics-summary', component: () => import('@/views/system/statistics-summary/index.vue'), - name: 'Index', + name: 'StatisticsSummaryHome', hidden: true, meta: { title: '统计汇总', icon: 'dashboard', affix: true } }); diff --git a/src/views/login.vue b/src/views/login.vue index 1e1fd07..c9f6ee4 100644 --- a/src/views/login.vue +++ b/src/views/login.vue @@ -112,7 +112,7 @@ const handleLogin = () => { // 调用action的登录方法 const [err] = await to(userStore.login(loginForm.value)); if (!err) { - // 登录后进入统计汇总页(/index,小区由后端默认,无需选择) + // 登录后进入统计汇总页(/statistics/statistics-summary,小区由后端默认,无需选择) await router.push(import.meta.env.VITE_LOGIN_BACK_URL || '/'); loading.value = false; } else {